#10867: extJS localization doesn't work
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Fri, 10 Apr 2009 16:20:50 +0000 (16:20 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Fri, 10 Apr 2009 16:20:50 +0000 (16:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5310 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/template.php

index 7024ecd..6e11778 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-04-10  Martin Kutschker  <masi@typo3.org>
 
        * Fixed bug #10866: extra extJS onready code not loaded with template.php
+       * Fixed bug #10867: extJS localization doesn't work
 
 2009-04-09  Stanislas Rolland  <typo3@sjbr.ca>
 
index 37f6263..c2e7ddf 100644 (file)
@@ -2007,7 +2007,15 @@ $str.=$this->docBodyTagBegin().
                        $libs[] = 'contrib/extjs/ext-all' . ($this->addExtJSdebug ? '-debug' : '') . '.js';
 
                                // add extJS localization
-                       $extJsLocaleFile = 'contrib/extjs/locale/ext-lang-' . $GLOBALS['BE_USER']->uc['lang'] . '.js';
+                       $localeMap = $GLOBAL['LANG']->csConvObj->isoArray;      // load standard ISO mapping and modify for use with ExtJS
+                       $localeMap[''] = 'en';
+                       $localeMap['default'] = 'en';
+                       $localeMap['gr'] = 'el_GR';     // Greek
+                       $localeMap['no'] = 'no_BO';     // Norwegian Bokmaal
+                       $localeMap['se'] = 'se_SV';     // Swedish
+                       $extJsLang = isset($localeMap[$GLOBALS['BE_USER']->uc['lang']]) ? $localeMap[$GLOBALS['BE_USER']->uc['lang']] : $GLOBALS['BE_USER']->uc['lang'];
+                       // TODO autoconvert file from UTF8 to current BE charset if necessary!!!!
+                       $extJsLocaleFile = 'contrib/extjs/locale/ext-lang-' . $extJsLang . '.js';
                        if (file_exists(PATH_typo3 . $extJsLocaleFile)) {
                                $libs[] = $extJsLocaleFile;
                        }