[FEATURE] Add XLIFF translation support (l10n)
authorXavier Perseguers <typo3@perseguers.ch>
Mon, 13 Jun 2011 11:09:47 +0000 (13:09 +0200)
committerXavier Perseguers <typo3@perseguers.ch>
Tue, 14 Jun 2011 13:49:40 +0000 (15:49 +0200)
Add a parser to support XLIFF + LLXML file as localization file format.

This patch includes:

* A parser factory to support multiple internationalization formats
(actually LLXML and XLIFF, parser for PHP array is not implemented,
yet). New parsers can be added in the future.
* A new parser for XLIFF (supporting plurals, based on the parser of
FLOW3)
* Autoload for sysext 'lang'
* Update the existing localization method (FE, BE, Extbase) to support
the new format of the LOCAL_LANG array
* New caching class based on the caching framework or file based
* Autodetection igbinary for cache un/serialization
* htmlArea RTE: update of the localization API

Currently the localization method works as before (only key-based
localization).

More functionality will be implemented in the new localization API
(plurals, ...). The current parser can be used on a TYPO3 instance with
LLXML and/or XLIFF files. However if an extension uses XLIFF, the
language pack (typo3conf/l10n) MUST use the same format.

The parser and the format priority (by default: xlf, xml, php), can be
configured in $TYPO3_CONF_VARS['SYS']['lang'].

Change-Id: I84d0a463f1b5448b4bca3f7d200315f397f4ea18
Resolves: #25397
Reviewed-on: http://review.typo3.org/2572
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
38 files changed:
t3lib/class.t3lib_div.php
t3lib/class.t3lib_pagerenderer.php
t3lib/config_default.php
t3lib/core_autoload.php
typo3/index.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_pibase.php
typo3/sysext/em/res/js/em_app.js
typo3/sysext/em/res/js/em_components.js
typo3/sysext/em/res/js/em_files.js
typo3/sysext/em/res/js/em_languages.js
typo3/sysext/em/res/js/em_layouts.js
typo3/sysext/em/res/js/em_locallist.js
typo3/sysext/em/res/js/em_repositorylist.js
typo3/sysext/em/res/js/em_settings.js
typo3/sysext/em/res/js/em_ter.js
typo3/sysext/em/res/js/em_tools.js
typo3/sysext/em/res/js/em_usertools.js
typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php
typo3/sysext/lang/classes/cache/class.tx_lang_cache_abstract.php [new file with mode: 0644]
typo3/sysext/lang/classes/cache/class.tx_lang_cache_cachingframework.php [new file with mode: 0644]
typo3/sysext/lang/classes/cache/class.tx_lang_cache_file.php [new file with mode: 0644]
typo3/sysext/lang/classes/class.tx_lang_factory.php [new file with mode: 0644]
typo3/sysext/lang/classes/class.tx_lang_store.php [new file with mode: 0644]
typo3/sysext/lang/classes/exception/class.tx_lang_exception_filenotfound.php [new file with mode: 0644]
typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidparser.php [new file with mode: 0644]
typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidxmlfile.php [new file with mode: 0644]
typo3/sysext/lang/classes/interfaces/interface.tx_lang_parser.php [new file with mode: 0644]
typo3/sysext/lang/classes/parser/class.tx_lang_parser_abstractxml.php [new file with mode: 0644]
typo3/sysext/lang/classes/parser/class.tx_lang_parser_llphp.php [new file with mode: 0644]
typo3/sysext/lang/classes/parser/class.tx_lang_parser_llxml.php [new file with mode: 0644]
typo3/sysext/lang/classes/parser/class.tx_lang_parser_xliff.php [new file with mode: 0644]
typo3/sysext/lang/ext_autoload.php [new file with mode: 0644]
typo3/sysext/lang/lang.php
typo3/sysext/lang/res/js/be/typo3lang.js [new file with mode: 0644]
typo3/sysext/recycler/res/js/t3_recycler.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/setup/mod/index.php

index 0f9c960..dadaa2f 100644 (file)
@@ -4406,58 +4406,9 @@ final class t3lib_div {
         *                                               Otherwise an empty array and it is FALSE in error case.
         */
        public static function readLLfile($fileRef, $langKey, $charset = '', $errorMode = 0) {
-
-               $result = FALSE;
-               $file = self::getFileAbsFileName($fileRef);
-               if ($file) {
-                       $baseFile = preg_replace('/\.(php|xml)$/', '', $file);
-
-                       if (@is_file($baseFile . '.xml')) {
-                               $LOCAL_LANG = self::readLLXMLfile($baseFile . '.xml', $langKey, $charset);
-                       } elseif (@is_file($baseFile . '.php')) {
-                               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] || $charset) {
-                                       $LOCAL_LANG = self::readLLPHPfile($baseFile . '.php', $langKey, $charset);
-                               } else {
-                                       include($baseFile . '.php');
-                                       if (is_array($LOCAL_LANG)) {
-                                               $LOCAL_LANG = array('default' => $LOCAL_LANG['default'], $langKey => $LOCAL_LANG[$langKey]);
-                                       }
-                               }
-                       } else {
-                               $errorMsg = 'File "' . $fileRef . '" not found!';
-                               if ($errorMode == 2) {
-                                       throw new t3lib_exception($errorMsg);
-                               } elseif (!$errorMode) {
-                                       self::sysLog($errorMsg, 'Core', self::SYSLOG_SEVERITY_ERROR);
-                               }
-                               $fileNotFound = TRUE;
-                       }
-
-
-                       $overrides = array();
-                       $fileRefWithoutExtension = preg_replace('/\.(php|xml)$/', '', $fileRef);
-
-                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][$fileRefWithoutExtension . '.php'])) {
-                               $overrides = array_merge($overrides, $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][$fileRefWithoutExtension . '.php']);
-                       }
-                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][$fileRefWithoutExtension . '.xml'])) {
-                               $overrides = array_merge($overrides, $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'][$fileRefWithoutExtension . '.xml']);
-                       }
-
-                       if (count($overrides) > 0) {
-                               foreach ($overrides as $overrideFile) {
-                                       $languageOverrideFileName = self::getFileAbsFileName($overrideFile);
-                                       if (@is_file($languageOverrideFileName)) {
-                                               $languageOverrideArray = self::readLLXMLfile($languageOverrideFileName, $langKey, $charset);
-                                               $LOCAL_LANG = self::array_merge_recursive_overrule($LOCAL_LANG, $languageOverrideArray);
-                                       }
-                               }
-                       }
-               }
-               if ($fileNotFound !== TRUE) {
-                       $result = is_array($LOCAL_LANG) ? $LOCAL_LANG : array();
-               }
-               return $result;
+               /** @var $languageFactory tx_lang_Factory */
+               $languageFactory = t3lib_div::makeInstance('tx_lang_Factory');
+               return $languageFactory->getParsedData($fileRef, $langKey, $charset, $errorMode);
        }
 
        /**
@@ -4468,8 +4419,10 @@ final class t3lib_div {
         * @param       string          TYPO3 language key, eg. "dk" or "de" or "default"
         * @param       string          Character set (optional)
         * @return      array           LOCAL_LANG array in return.
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - use tx_lang_parser_Llphp::getParsedData() from now on
         */
        public static function readLLPHPfile($fileRef, $langKey, $charset = '') {
+               t3lib_div::logDeprecatedFunction();
 
                if (is_object($GLOBALS['LANG'])) {
                        $csConvObj = $GLOBALS['LANG']->csConvObj;
@@ -4551,8 +4504,10 @@ final class t3lib_div {
         * @param       string          TYPO3 language key, eg. "dk" or "de" or "default"
         * @param       string          Character set (optional)
         * @return      array           LOCAL_LANG array in return.
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - use tx_lang_parser_Llxml::getParsedData() from now on
         */
        public static function readLLXMLfile($fileRef, $langKey, $charset = '') {
+               t3lib_div::logDeprecatedFunction();
 
                if (is_object($GLOBALS['LANG'])) {
                        $csConvObj = $GLOBALS['LANG']->csConvObj;
@@ -4697,6 +4652,15 @@ final class t3lib_div {
                                }
                        }
 
+                               // Convert the $LOCAL_LANG array to XLIFF structure
+                       foreach ($LOCAL_LANG as $languageKey => $keysLabels) {
+                               foreach ($keysLabels as $key => $label) {
+                                       $LOCAL_LANG[$languageKey][$key] = array(0 => array(
+                                               'target' => $label,
+                                       ));
+                               }
+                       }
+
                        return $LOCAL_LANG;
                }
        }
index 7348a9c..fd93b9b 100644 (file)
@@ -1735,6 +1735,11 @@ class t3lib_PageRenderer implements t3lib_Singleton {
                }
                unset($this->inlineLanguageLabelFiles);
 
+                       // Include TYPO3.l18n object
+               if (TYPO3_MODE === 'BE') {
+                       $out .= '<script src="' . $this->processJsFile($this->backPath . 'sysext/lang/res/js/be/typo3lang.js') . '" type="text/javascript" charset="utf-8"></script>' . LF;
+               }
+
                        // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8:
                if ($this->getCharSet() !== 'utf-8') {
                        if ($this->inlineLanguageLabels) {
index f937c49..dda34e3 100644 (file)
@@ -56,6 +56,16 @@ $TYPO3_CONF_VARS = array(
                'png_truecolor' => FALSE,                               // Boolean: If set PNGs will get created as truecolor PNGs. If you use GDlib2 you can create truecolor images if they look not well currently. Note that this results in an increased image size. JPEGs get always created in truecolor now (GDlib2 required)
        ),
        'SYS' => array(                 // System related concerning both frontend and backend.
+               'lang' => array(
+                       'format' => array(
+                               'priority' => 'xlf,xml,php'
+                       ),
+                       'parser' => array(
+                               'php' => 'tx_lang_parser_Llphp',
+                               'xml' => 'tx_lang_parser_Llxml',
+                               'xlf' => 'tx_lang_parser_Xliff',
+                       ),
+               ),
                'sitename' => 'TYPO3',                                  // Name of the base-site. This title shows up in the root of the tree structure if you're an 'admin' backend user.
                'compat_version' => '3.8',                              // Compatibility version. TYPO3 behavior will try to be compatible with the output from the TYPO3 version set here. It is recommended to change this setting with the Upgrade Wizard.
                'encryptionKey' => '',                                  // This is a "salt" used for various kinds of encryption, CRC checksums and validations. You can enter any rubbish string here but try to keep it secret. You should notice that a change to this value might invalidate temporary information, URLs etc. At least, clear all cache if you change this so any such information can be rebuild with the new key.
@@ -182,6 +192,9 @@ $TYPO3_CONF_VARS = array(
                ),
        ),
        'BE' => array(          // Backend Configuration.
+               'lang' => array(
+                       'degug' => FALSE,                                       // Debug LL in the backend
+               ),
                'unzip_path' => '',                                             // Path to "unzip".
                'diff_path' => 'diff',                                  // Path to "diff". For Windows this program can be downloaded here: <a href="http://unxutils.sourceforge.net/" target="_blank">unxutils.sourceforge.net</a>
                'fileadminDir' => 'fileadmin/',                 // Path to the fileadmin dir. This is relative to PATH_site. (Automatically mounted for admin-users if set)
index f259df3..aefd876 100644 (file)
@@ -219,4 +219,4 @@ $t3libClasses = array(
 $tslibClasses = require(PATH_typo3 . 'sysext/cms/ext_autoload.php');
 
 return array_merge($t3libClasses, $tslibClasses);
-?>
+?>
\ No newline at end of file
index 2b7fb7b..9281a7e 100644 (file)
@@ -810,7 +810,7 @@ class SC_index {
                                }
                                        // now override the labels from the LOCAL_LANG with the TYPO3_CONF_VARS
                                foreach ($overrideLabelKeys as $labelKey => $label) {
-                                       $GLOBALS['LOCAL_LANG'][$lang][$labelKey] = $GLOBALS['LOCAL_LANG']['default'][$labelKey] = $label;
+                                       $GLOBALS['LANG']->overrideLL($labelKey, $label);
                                }
                        }
                }
index 57dc4da..5735554 100644 (file)
@@ -4791,12 +4791,14 @@ if (version == "n3") {
         * @param       array           The locallang array in which to search
         * @return      string          Label value of $index key.
         */
-       function getLLL($index, &$LOCAL_LANG)   {
-               if (strcmp($LOCAL_LANG[$this->lang][$index],''))        {
-                       return $LOCAL_LANG[$this->lang][$index];
-               } else {
-                       return $LOCAL_LANG['default'][$index];
+       function getLLL($index, $LOCAL_LANG) {
+               if (isset($LOCAL_LANG[$this->lang][$index][0]['target'])) {
+                       return $LOCAL_LANG[$this->lang][$index][0]['target'];
+               } elseif (isset($LOCAL_LANG['default'][$index][0]['target'])) {
+                       return $LOCAL_LANG['default'][$index][0]['target'];
                }
+
+               return FALSE;
        }
 
        /**
index 82a67c4..ba6fc4a 100644 (file)
@@ -933,20 +933,44 @@ class tslib_pibase {
         * @param       boolean         If TRUE, the output label is passed through htmlspecialchars()
         * @return      string          The value from LOCAL_LANG.
         */
-       function pi_getLL($key,$alt='',$hsc=FALSE)      {
-                       // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
-               if (isset($this->LOCAL_LANG[$this->LLkey][$key]))       {
-                       $word = $GLOBALS['TSFE']->csConv($this->LOCAL_LANG[$this->LLkey][$key], $this->LOCAL_LANG_charset[$this->LLkey][$key]);
-               } elseif ($this->altLLkey && isset($this->LOCAL_LANG[$this->altLLkey][$key]))   {
-                       $word = $GLOBALS['TSFE']->csConv($this->LOCAL_LANG[$this->altLLkey][$key], $this->LOCAL_LANG_charset[$this->altLLkey][$key]);
-               } elseif (isset($this->LOCAL_LANG['default'][$key]))    {
-                       $word = $this->LOCAL_LANG['default'][$key];     // No charset conversion because default is english and thereby ASCII
+       public function pi_getLL($key, $alternativeLabel = '', $hsc = FALSE) {
+               if (isset($this->LOCAL_LANG[$this->LLkey][$key][0]['target'])) {
+
+                               // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
+                       if (isset($this->LOCAL_LANG_charset[$this->LLkey][$key])) {
+                               $word = $GLOBALS['TSFE']->csConv(
+                                       $this->LOCAL_LANG[$this->LLkey][$key][0]['target'],
+                                       $this->LOCAL_LANG_charset[$this->LLkey][$key]
+                               );
+                       } else {
+                               $word = $this->LOCAL_LANG[$this->LLkey][$key][0]['target'];
+                       }
+               } elseif ($this->altLLkey && isset($this->LOCAL_LANG[$this->altLLkey][$key][0]['target'])) {
+
+                               // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
+                       if (isset($this->LOCAL_LANG_charset[$this->altLLkey][$key])) {
+                               $word = $GLOBALS['TSFE']->csConv(
+                                       $this->LOCAL_LANG[$this->altLLkey][$key][0]['target'],
+                                       $this->LOCAL_LANG_charset[$this->altLLkey][$key]
+                               );
+                       } else {
+                               $word = $this->LOCAL_LANG[$this->altLLkey][$key][0]['target'];
+                       }
+               } elseif (isset($this->LOCAL_LANG['default'][$key][0]['target'])) {
+
+                               // Get default translation (without charset conversion, english)
+                       $word = $this->LOCAL_LANG['default'][$key][0]['target'];
                } else {
-                       $word = $this->LLtestPrefixAlt.$alt;
+
+                               // Return alternative string or empty
+                       $word = (isset($this->LLtestPrefixAlt)) ? $this->LLtestPrefixAlt . $alternativeLabel : $alternativeLabel;
                }
 
-               $output = $this->LLtestPrefix.$word;
-               if ($hsc)       $output = htmlspecialchars($output);
+               $output = (isset($this->LLtestPrefix)) ? $this->LLtestPrefix . $word : $word;
+
+               if ($hsc) {
+                       $output = htmlspecialchars($output);
+               }
 
                return $output;
        }
@@ -957,28 +981,35 @@ class tslib_pibase {
         *
         * @return      void
         */
-       function pi_loadLL()    {
-               if (!$this->LOCAL_LANG_loaded && $this->scriptRelPath)  {
+       public function pi_loadLL() {
+               if (!$this->LOCAL_LANG_loaded && $this->scriptRelPath) {
                        $basePath = 'EXT:' . $this->extKey . '/' . dirname($this->scriptRelPath) . '/locallang.xml';
 
                                // Read the strings in the required charset (since TYPO3 4.2)
-                       $this->LOCAL_LANG = t3lib_div::readLLfile($basePath,$this->LLkey,$GLOBALS['TSFE']->renderCharset);
-                       if ($this->altLLkey)    {
-                               $tempLOCAL_LANG = t3lib_div::readLLfile($basePath,$this->altLLkey);
-                               $this->LOCAL_LANG = array_merge(is_array($this->LOCAL_LANG) ? $this->LOCAL_LANG : array(),$tempLOCAL_LANG);
+                       $this->LOCAL_LANG = t3lib_div::readLLfile($basePath,$this->LLkey, $GLOBALS['TSFE']->renderCharset);
+                       if ($this->altLLkey) {
+                               $this->LOCAL_LANG = t3lib_div::readLLfile($basePath,$this->altLLkey);
                        }
 
                                // Overlaying labels from TypoScript (including fictitious language keys for non-system languages!):
                        $confLL = $this->conf['_LOCAL_LANG.'];
                        if (is_array($confLL)) {
-                               foreach ($confLL as $k => $lA) {
-                                       if (is_array($lA))      {
-                                               $k = substr($k,0,-1);
-                                               foreach($lA as $llK => $llV)    {
-                                                       if (!is_array($llV))    {
-                                                               $this->LOCAL_LANG[$k][$llK] = $llV;
-                                                                       // For labels coming from the TypoScript (database) the charset is assumed to be "forceCharset" and if that is not set, assumed to be that of the individual system languages
-                                                               $this->LOCAL_LANG_charset[$k][$llK] = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : $GLOBALS['TSFE']->csConvObj->charSetArray[$k];
+                               foreach ($confLL as $languageKey => $languageArray) {
+                                               // Don't process label if the langue is not loaded
+                                       $languageKey = substr($languageKey,0,-1);
+                                       if (is_array($languageArray) && is_array($this->LOCAL_LANG[$languageKey])) {
+                                                       // Remove the dot after the language key
+                                               foreach ($languageArray as $labelKey => $labelValue) {
+                                                       if (!is_array($labelValue))     {
+                                                               $this->LOCAL_LANG[$languageKey][$labelKey][0]['target'] = $labelValue;
+
+                                                                       // For labels coming from the TypoScript (database) the charset is assumed to be "forceCharset"
+                                                                       // and if that is not set, assumed to be that of the individual system languages
+                                                               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) {
+                                                                       $this->LOCAL_LANG_charset[$languageKey][$labelKey] = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];
+                                                               } else {
+                                                                       $this->LOCAL_LANG_charset[$languageKey][$labelKey] = $GLOBALS['TSFE']->csConvObj->charSetArray[$languageKey];
+                                                               }
                                                        }
                                                }
                                        }
index 4c41be4..c1c713c 100644 (file)
@@ -53,19 +53,19 @@ TYPO3.EM.AdditionalApplicationItems = [];
 
 TYPO3.EM.App = {
        refreshLocalList: false,
-       loadingIndicor: '<div class="loading-indicator">' + TYPO3.lang.action_loading + '</div>',
+       loadingIndicor: '<div class="loading-indicator">' + TYPO3.l10n.localize('action_loading') + '</div>',
 
        categoryLabels : [
-                       TYPO3.lang.category_BE,
-                       TYPO3.lang.category_BE_modules,
-                       TYPO3.lang.category_FE,
-                       TYPO3.lang.category_FE_plugins,
-                       TYPO3.lang.category_miscellanous,
-                       TYPO3.lang.category_services,
-                       TYPO3.lang.category_templates,
+                       TYPO3.l10n.localize('category_BE'),
+                       TYPO3.l10n.localize('category_BE_modules'),
+                       TYPO3.l10n.localize('category_FE'),
+                       TYPO3.l10n.localize('category_FE_plugins'),
+                       TYPO3.l10n.localize('category_miscellanous'),
+                       TYPO3.l10n.localize('category_services'),
+                       TYPO3.l10n.localize('category_templates'),
                        '',
-                       TYPO3.lang.category_documentation,
-                       TYPO3.lang.category_examples
+                       TYPO3.l10n.localize('category_documentation'),
+                       TYPO3.l10n.localize('category_examples')
        ],
 
        init : function() {
index 97bff97..ad14372 100644 (file)
@@ -38,7 +38,7 @@ Ext.ns('TYPO3.EM', 'TYPO3.EM.GridColumns', 'TYPO3.EM.ExtDirect', 'TYPO3.EMSOAP.E
 TYPO3.EM.Filters = new Ext.ux.grid.GridFilters({
        encode: true,
        local: true,
-       menuFilterText: TYPO3.lang.cmd_filter,
+       menuFilterText: TYPO3.l10n.localize('cmd_filter'),
        filters: [
                {
                        type: 'string',
@@ -56,13 +56,13 @@ TYPO3.EM.Filters = new Ext.ux.grid.GridFilters({
                        type: 'list',
                        dataIndex: 'state',
                        options: [
-                               TYPO3.lang.state_alpha,
-                               TYPO3.lang.state_beta,
-                               TYPO3.lang.state_stable,
-                               TYPO3.lang.state_experimental,
-                               TYPO3.lang.state_test,
-                               TYPO3.lang.state_obsolete,
-                               TYPO3.lang.state_exclude_from_updates
+                               TYPO3.l10n.localize('state_alpha'),
+                               TYPO3.l10n.localize('state_beta'),
+                               TYPO3.l10n.localize('state_stable'),
+                               TYPO3.l10n.localize('state_experimental'),
+                               TYPO3.l10n.localize('state_test'),
+                               TYPO3.l10n.localize('state_obsolete'),
+                               TYPO3.l10n.localize('state_exclude_from_updates')
                        ],
                        phpMode: true
                        }, {
@@ -71,7 +71,7 @@ TYPO3.EM.Filters = new Ext.ux.grid.GridFilters({
                }, {
                        type: 'list',
                        dataIndex: 'type',
-                       options: [TYPO3.lang.type_system, TYPO3.lang.type_global, TYPO3.lang.type_local],
+                       options: [TYPO3.l10n.localize('type_system'), TYPO3.l10n.localize('type_global'), TYPO3.l10n.localize('type_local')],
                        phpMode: true
                }
        ],
@@ -109,29 +109,29 @@ TYPO3.EM.RemoteFilters = new Ext.ux.grid.GridFilters({
                type: 'list',
                dataIndex: 'statevalue',
                options: [
-                       [0, TYPO3.lang.state_alpha],
-                       [1, TYPO3.lang.state_beta],
-                       [2, TYPO3.lang.state_stable],
-                       [3, TYPO3.lang.state_experimental],
-                       [4, TYPO3.lang.state_test],
-                       [5, TYPO3.lang.state_obsolete],
-                       [6, TYPO3.lang.state_exclude_from_updates],
-                       [999, TYPO3.lang.translation_n_a]
+                       [0, TYPO3.l10n.localize('state_alpha')],
+                       [1, TYPO3.l10n.localize('state_beta')],
+                       [2, TYPO3.l10n.localize('state_stable')],
+                       [3, TYPO3.l10n.localize('state_experimental')],
+                       [4, TYPO3.l10n.localize('state_test')],
+                       [5, TYPO3.l10n.localize('state_obsolete')],
+                       [6, TYPO3.l10n.localize('state_exclude_from_updates')],
+                       [999, TYPO3.l10n.localize('translation_n_a')]
                ],
                phpMode: true
                }, {
                type: 'list',
                dataIndex: 'category',
                options: [
-                       [0, TYPO3.lang.category_BE],
-                       [1, TYPO3.lang.category_BE_modules],
-                       [2, TYPO3.lang.category_FE],
-                       [3, TYPO3.lang.category_FE_plugins],
-                       [4, TYPO3.lang.category_miscellanous],
-                       [5, TYPO3.lang.category_services],
-                       [6, TYPO3.lang.category_templates],
-                       [8, TYPO3.lang.category_documentation],
-                       [9, TYPO3.lang.category_examples]
+                       [0, TYPO3.l10n.localize('category_BE')],
+                       [1, TYPO3.l10n.localize('category_BE_modules')],
+                       [2, TYPO3.l10n.localize('category_FE')],
+                       [3, TYPO3.l10n.localize('category_FE_plugins')],
+                       [4, TYPO3.l10n.localize('category_miscellanous')],
+                       [5, TYPO3.l10n.localize('category_services')],
+                       [6, TYPO3.l10n.localize('category_templates')],
+                       [8, TYPO3.l10n.localize('category_documentation')],
+                       [9, TYPO3.l10n.localize('category_examples')]
                ],
                phpMode: true
                }, {
@@ -163,14 +163,14 @@ TYPO3.EM.GridColumns.InstallExtension = {
                {
                        getClass: function(value, meta, record) {
                                if (record.get('installed') == 0) {
-                                       this.items[0].tooltip = TYPO3.lang.menu_install_extensions;
+                                       this.items[0].tooltip = TYPO3.l10n.localize('menu_install_extensions');
                                        return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-install';
                                } else {
                                        if (record.get('required')) {
-                                               this.items[0].tooltip = TYPO3.lang.ext_details_always_loaded;
+                                               this.items[0].tooltip = TYPO3.l10n.localize('ext_details_always_loaded');
                                                return 't3-icon t3-icon-extensions t3-icon-extensions-em t3-icon-em-extension-required';
                                        } else {
-                                               this.items[0].tooltip = TYPO3.lang.ext_details_remove_ext;
+                                               this.items[0].tooltip = TYPO3.l10n.localize('ext_details_remove_ext');
                                                return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-uninstall';
                                        }
                                }
@@ -178,7 +178,7 @@ TYPO3.EM.GridColumns.InstallExtension = {
                        handler: function(grid, rowIndex, colIndex) {
                                var record = grid.store.getAt(rowIndex).data;
                                if (!record.required) {
-                                       var action = record.installed ? TYPO3.lang.ext_details_remove_ext : TYPO3.lang.menu_install_extensions;
+                                       var action = record.installed ? TYPO3.l10n.localize('ext_details_remove_ext') : TYPO3.l10n.localize('menu_install_extensions');
                                        var link = TYPO3.settings.EM.scriptLink
                                                        + '&nodoc=1&view=info&CMD[silentMode]=1&CMD[standAlone]=1&CMD[showExt]=' + record.extkey
                                                        + '&CMD[' + (record.installed ? 'remove' : 'load') + ']=1&CMD[clrCmd]=1&SET[singleDetails]=info';
@@ -229,21 +229,21 @@ TYPO3.EM.GridColumns.ImportExtension = {
                        getClass: function(value, meta, record) {
                                if (record.data.exists) {
                                        if (record.data.versionislower) {
-                                               this.items[0].tooltip = String.format(TYPO3.lang.menu_update_extension, record.data.existingVersion, record.data.version);
+                                               this.items[0].tooltip = String.format(TYPO3.l10n.localize('menu_update_extension'), record.data.existingVersion, record.data.version);
                                                return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-update';
                                        } else {
                                                return '';
                                        }
                                } else {
-                                       this.items[0].tooltip = TYPO3.lang.menu_import_extensions;
+                                       this.items[0].tooltip = TYPO3.l10n.localize('menu_import_extensions');
                                        return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-import';
                                }
                        },
                        handler: function(grid, rowIndex, colIndex) {
                                var record = grid.store.getAt(rowIndex).data;
-                               var action = TYPO3.lang.menu_import_extensions;
+                               var action = TYPO3.l10n.localize('menu_import_extensions');
                                if (record.exists && record.versionislower) {
-                                       action = TYPO3.lang.menu_update_extensions;
+                                       action = TYPO3.l10n.localize('menu_update_extensions');
                                }
                                var link = TYPO3.settings.EM.scriptLink
                                                + '&nodoc=1&view=info&CMD[silentMode]=1&CMD[standAlone]=1&ter_connect=1&CMD[importExt]='
@@ -281,7 +281,7 @@ TYPO3.EM.GridColumns.ImportExtension = {
 
 
 TYPO3.EM.GridColumns.ExtensionTitle = {
-       header: TYPO3.lang.tab_mod_name,
+       header: TYPO3.l10n.localize('tab_mod_name'),
        width: 150,
        sortable: true,
        dataIndex: 'title',
@@ -295,7 +295,7 @@ TYPO3.EM.GridColumns.ExtensionTitle = {
                }
                if (record.data.reviewstate < 0) {
                        metaData.css += ' insecureExtension';
-                       description += '<br><br><strong>' + TYPO3.lang.insecureExtension + '</strong>';
+                       description += '<br><br><strong>' + TYPO3.l10n.localize('insecureExtension') + '</strong>';
                }
                if (description) {
                        metaData.attr = 'ext:qtip="' + Ext.util.Format.htmlEncode(description) + '"';
@@ -306,7 +306,7 @@ TYPO3.EM.GridColumns.ExtensionTitle = {
 };
 
 TYPO3.EM.GridColumns.ExtensionKey = {
-       header: TYPO3.lang.tab_mod_key,
+       header: TYPO3.l10n.localize('tab_mod_key'),
        width: 80,
        sortable: true,
        filterable: true,
@@ -318,7 +318,7 @@ TYPO3.EM.GridColumns.ExtensionKey = {
 };
 
 TYPO3.EM.GridColumns.ExtensionCategory = {
-       header: TYPO3.lang.list_order_category,
+       header: TYPO3.l10n.localize('list_order_category'),
        width: 70,
        sortable: true,
        dataIndex: 'category',
@@ -328,7 +328,7 @@ TYPO3.EM.GridColumns.ExtensionCategory = {
 };
 
 TYPO3.EM.GridColumns.ExtensionCategoryRemote = {
-       header: TYPO3.lang.list_order_category,
+       header: TYPO3.l10n.localize('list_order_category'),
        width: 70,
        sortable: true,
        hideable: true,
@@ -339,7 +339,7 @@ TYPO3.EM.GridColumns.ExtensionCategoryRemote = {
 };
 
 TYPO3.EM.GridColumns.ExtensionAuthor = {
-       header: TYPO3.lang.list_order_author,
+       header: TYPO3.l10n.localize('list_order_author'),
        width: 120,
        sortable: true,
        hidden: true,
@@ -360,7 +360,7 @@ TYPO3.EM.GridColumns.ExtensionAuthor = {
 };
 
 TYPO3.EM.GridColumns.ExtensionRemoteAuthor = {
-       header: TYPO3.lang.list_order_author,
+       header: TYPO3.l10n.localize('list_order_author'),
        width: 120,
        sortable: true,
        hidden: true,
@@ -378,7 +378,7 @@ TYPO3.EM.GridColumns.ExtensionRemoteAuthor = {
 };
 
 TYPO3.EM.GridColumns.ExtensionType = {
-       header: TYPO3.lang.list_order_type,
+       header: TYPO3.l10n.localize('list_order_type'),
        width:50,
        sortable:true,
        dataIndex:'type',
@@ -389,14 +389,14 @@ TYPO3.EM.GridColumns.ExtensionType = {
                if (record.data.doubleInstallShort && record.data.doubleInstallShort.length > 1) {
                        var temp = record.data.doubleInstall.split('/');
                        value = '<strong>' + record.data.doubleInstall + '</strong>';
-                       metaData.attr = 'ext:qtip="' + String.format(TYPO3.lang.double_inclusion_js, temp[1], temp[0]) + '"';
+                       metaData.attr = 'ext:qtip="' + String.format(TYPO3.l10n.localize('double_inclusion_js'), temp[1], temp[0]) + '"';
                }
                return value;
        }
 };
 
 TYPO3.EM.GridColumns.ExtensionState = {
-       header: TYPO3.lang.list_order_state,
+       header: TYPO3.l10n.localize('list_order_state'),
        align: 'center',
        width: 100,
        sortable: true,
@@ -412,7 +412,7 @@ TYPO3.EM.GridColumns.ExtensionState = {
 };
 
 TYPO3.EM.GridColumns.ExtensionStateValue = {
-       header: TYPO3.lang.list_order_state,
+       header: TYPO3.l10n.localize('list_order_state'),
        align: 'center',
        width: 100,
        sortable: true,
@@ -422,28 +422,28 @@ TYPO3.EM.GridColumns.ExtensionStateValue = {
        dataIndex:'statevalue',
        renderer: function(value, metaData, record, rowIndex, colIndex, store){
                metaData.css += record.data.stateCls + ' ';
-               var label = TYPO3.lang.translation_n_a;
+               var label = TYPO3.l10n.localize('translation_n_a');
                switch (parseInt(value, 10)) {
                        case 0:
-                               label = TYPO3.lang.state_alpha;
+                               label = TYPO3.l10n.localize('state_alpha');
                        break;
                        case 1:
-                               label = TYPO3.lang.state_beta;
+                               label = TYPO3.l10n.localize('state_beta');
                        break;
                        case 2:
-                               label = TYPO3.lang.state_stable;
+                               label = TYPO3.l10n.localize('state_stable');
                        break;
                        case 3:
-                               label = TYPO3.lang.state_experimental;
+                               label = TYPO3.l10n.localize('state_experimental');
                        break;
                        case 4:
-                               label = TYPO3.lang.state_test;
+                               label = TYPO3.l10n.localize('state_test');
                        break;
                        case 5:
-                               label = TYPO3.lang.state_obsolete;
+                               label = TYPO3.l10n.localize('state_obsolete');
                        break;
                        case 6:
-                               label = TYPO3.lang.state_exclude_from_updates;
+                               label = TYPO3.l10n.localize('state_exclude_from_updates');
                        break;
                }
                return label;
@@ -452,7 +452,7 @@ TYPO3.EM.GridColumns.ExtensionStateValue = {
 };
 
 TYPO3.EM.GridColumns.ExtensionDownloads = {
-       header: TYPO3.lang.list_order_downloads,
+       header: TYPO3.l10n.localize('list_order_downloads'),
        width: 40,
        sortable: true,
        hideable: true,
@@ -464,7 +464,7 @@ TYPO3.EM.GridColumns.ExtensionDownloads = {
 };
 
 TYPO3.EM.GridColumns.ExtensionVersion = {
-       header: TYPO3.lang.extInfoArray_version,
+       header: TYPO3.l10n.localize('extInfoArray_version'),
        width:40,
        sortable: true,
        hideable: true,
@@ -473,7 +473,7 @@ TYPO3.EM.GridColumns.ExtensionVersion = {
 };
 
 TYPO3.EM.GridColumns.Relevance = {
-       header: TYPO3.lang.extInfoArray_relevance,
+       header: TYPO3.l10n.localize('extInfoArray_relevance'),
        width:40,
        sortable: true,
        hideable: true,
@@ -498,7 +498,7 @@ TYPO3.EM.LocationStore = new Ext.data.JsonStore({
 ///////////////////////////////////////////////////////
 
 TYPO3.EM.LocalListTab = {
-       title : TYPO3.lang.localExtensions,
+       title : TYPO3.l10n.localize('localExtensions'),
        xtype: 'TYPO3.EM.LocalList',
        id: 'em-local-extensions',
        listeners: {
@@ -512,7 +512,7 @@ TYPO3.EM.LocalListTab = {
 };
 
 TYPO3.EM.RepositoryListTab = {
-       title : TYPO3.lang.remoteRepository,
+       title : TYPO3.l10n.localize('remoteRepository'),
        layout: 'fit',
        items: [/*{
                xtype: 'repository',
@@ -527,7 +527,7 @@ TYPO3.EM.RepositoryListTab = {
 };
 
 TYPO3.EM.LanguageTab = {
-       title: TYPO3.lang.menu_language_packges,
+       title: TYPO3.l10n.localize('menu_language_packges'),
        xtype: 'extlanguages',
        id: 'em-translations',
        listeners: {
@@ -545,12 +545,12 @@ TYPO3.EM.LanguageTab = {
 };
 
 TYPO3.EM.SettingsTab = {
-       title: TYPO3.lang.menu_settings,
+       title: TYPO3.l10n.localize('menu_settings'),
        xtype: 'extsettings'
 };
 
 TYPO3.EM.UserTab = {
-       title: TYPO3.lang.myExtensions,
+       title: TYPO3.l10n.localize('myExtensions'),
        xtype: 'TYPO3.EM.UserTools',
        disabled: !TYPO3.settings.EM.hasCredentials,
        listeners: {
@@ -612,12 +612,12 @@ TYPO3.EM.LanguagesActionPanel = {
        },
        items: [{
                xtype: 'button',
-               text: TYPO3.lang.translation_check_status_button,
+               text: TYPO3.l10n.localize('translation_check_status_button'),
                id: 'lang-checkbutton',
                margins: '0 10 10 0'
        }, {
                xtype: 'button',
-               text: TYPO3.lang.translation_update_button,
+               text: TYPO3.l10n.localize('translation_update_button'),
                id: 'lang-updatebutton',
                margins: '0 0 10 10'
        }]
@@ -719,60 +719,60 @@ TYPO3.EM.TerUpload = Ext.extend(Ext.form.FormPanel, {
 
                        defaults: {width: 350},
                        items: [{
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_username,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_username'),
                                name: 'fe_u'
                        }, {
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_password,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_password'),
                                inputType: 'password',
                                name: 'fe_p'
                        }, {
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_changelog,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_changelog'),
                                xtype: 'textarea',
                                height: 150,
                                name: 'uploadcomment'
                        }, {
                                xtype: 'radiogroup',
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_new_version,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_new_version'),
                                itemCls: 'x-check-group-alt',
                                columns: 1,
                                items: [
                                        {
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_bugfix.replace('%s', 'x.x.<strong><span class="typo3-red">x+1</span></strong>'),
+                                               boxLabel: TYPO3.l10n.localize('repositoryUploadForm_new_bugfix').replace('%s', 'x.x.<strong><span class="typo3-red">x+1</span></strong>'),
                                                name: 'newversion',
                                                inputValue: 'new_dev',
                                                checked: true
                                        },
                                        {
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_sub_version.replace('%s', 'x.<strong><span class="typo3-red">x+1</span></strong>.0'),
+                                               boxLabel: TYPO3.l10n.localize('repositoryUploadForm_new_sub_version').replace('%s', 'x.<strong><span class="typo3-red">x+1</span></strong>.0'),
                                                name: 'newversion',
                                                inputValue: 'new_sub'
                                        },
                                        {
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_main_version.replace('%s', '<strong><span class="typo3-red">x+1</span></strong>.0.0'),
+                                               boxLabel: TYPO3.l10n.localize('repositoryUploadForm_new_main_version').replace('%s', '<strong><span class="typo3-red">x+1</span></strong>.0.0'),
                                                name: 'newversion',
                                                inputValue: 'new_main'
                                        }
                                ]
                        }, {
                                xtype: 'button',
-                               text: TYPO3.lang.repositoryUploadForm_upload,
+                               text: TYPO3.l10n.localize('repositoryUploadForm_upload'),
                                scope: this,
                                handler: function() {
                                        this.form.submit({
-                                               waitMsg : TYPO3.lang.action_sending_data,
+                                               waitMsg : TYPO3.l10n.localize('action_sending_data'),
                                                success: function(form, action) {
-                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.cmd_terupload, TYPO3.lang.msg_terupload, 5);
+                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('cmd_terupload'), TYPO3.l10n.localize('msg_terupload'), 5);
                                                        form.reset();
                                                },
                                                failure: function(form, action) {
                                                        if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                                               TYPO3.lang.list_order_state + ':' + action.response.status + ': ' +
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                                               TYPO3.l10n.localize('list_order_state') + ':' + action.response.status + ': ' +
                                                                                action.response.statusText, 15);
                                                        }
                                                        if (action.failureType === Ext.form.Action.SERVER_INVALID){
                                                                // server responded with success = false
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.errormsg, 5);
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_invalid'), action.result.errormsg, 5);
                                                        }
                                                }
                                        });
@@ -838,7 +838,7 @@ TYPO3.EM.ExtensionUploadWindow = Ext.extend(Ext.Window, {
                                                {
                                                        xtype: 'fileuploadfield',
                                                        id: 'form-file',
-                                                       emptyText: TYPO3.lang.upload_selectExtension,
+                                                       emptyText: TYPO3.l10n.localize('upload_selectExtension'),
                                                        fieldLabel: 'Extension',
                                                        name: 'extupload-path',
                                                        buttonText: '...',
@@ -853,13 +853,13 @@ TYPO3.EM.ExtensionUploadWindow = Ext.extend(Ext.Window, {
                                                TYPO3.EM.UploadLocationCombo,
                                                {
                                                        xtype: 'checkbox',
-                                                       fieldLabel: TYPO3.lang.overwrite_ext,
+                                                       fieldLabel: TYPO3.l10n.localize('overwrite_ext'),
                                                        name: 'uploadOverwrite',
                                                        labelWidth: 250
                                                },
                                                {
                                                        xtype: 'button',
-                                                       text: TYPO3.lang.upload_ext_from,
+                                                       text: TYPO3.l10n.localize('upload_ext_from'),
                                                        id: 'uploadSubmitButton',
                                                        width: 420,
                                                        scope: this,
@@ -867,22 +867,22 @@ TYPO3.EM.ExtensionUploadWindow = Ext.extend(Ext.Window, {
                                                                var form = this.getComponent('uploadForm').getForm();
                                                                if (form.isValid()) {
                                                                        form.submit({
-                                                                               waitMsg : TYPO3.lang.action_sending_data,
+                                                                               waitMsg : TYPO3.l10n.localize('action_sending_data'),
                                                                                success: function(form, action) {
                                                                                        form.reset();
-                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.upload_ext, String.format(TYPO3.lang.msg_uploaded, action.result.extKey), 5);
+                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('upload_ext'), String.format(TYPO3.l10n.localize('msg_uploaded'), action.result.extKey), 5);
                                                                                        TYPO3.EM.ExtensionUploadWindowInstance.hide();
                                                                                        TYPO3.EM.Tools.displayLocalExtension(action.result.extKey, true);
                                                                                },
                                                                                failure: function(form, action) {
                                                                                        if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                                                                               TYPO3.lang.msg_status + ': ' + action.response.status + ': ' +
+                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                                                                               TYPO3.l10n.localize('msg_status') + ': ' + action.response.status + ': ' +
                                                                                                                                action.response.statusText, 15);
                                                                                        }
                                                                                        if (action.failureType === Ext.form.Action.SERVER_INVALID) {
                                                                                                // server responded with success = false
-                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.error, 5);
+                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_invalid'), action.result.error, 5);
                                                                                        }
                                                                                }
                                                                        });
index f42ff67..478dc67 100644 (file)
@@ -14,7 +14,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
        isWindow: false,
        loaderUrl: null,
        rootIcon: 'sysext/t3skin/icons/module_tools_em.png',
-       rootText: TYPO3.lang.ext_details_ext_files,
+       rootText: TYPO3.l10n.localize('ext_details_ext_files'),
        baseParams: null,
        treeId: null,
        fileContent: '',
@@ -84,9 +84,9 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                var action = dropEvent.rawEvent.ctrlKey ? 'copy' : 'move';
                                dropEvent.tree.dragZone.proxy.animRepair = false;
                                dropEvent.cancel = true;
-                               var question = this.copyAction ? TYPO3.lang.fileEditCopyConfirmation : TYPO3.lang.fileEditMoveConfirmation;
+                               var question = this.copyAction ? TYPO3.l10n.localize('fileEditCopyConfirmation') : TYPO3.l10n.localize('fileEditMoveConfirmation');
 
-                               Ext.Msg.confirm(TYPO3.lang.fileEditOperation, String.format(question, dropEvent.dropNode.text, dropEvent.target.text), function(button) {
+                               Ext.Msg.confirm(TYPO3.l10n.localize('fileEditOperation'), String.format(question, dropEvent.dropNode.text, dropEvent.target.text), function(button) {
                                        if (button == 'yes') {
                                                TYPO3.EM.ExtDirect.moveFile(dropEvent.dropNode.id, dropEvent.target.id, !dropEvent.dropNode.leaf, function(response) {
                                                        if (response.success) {
@@ -137,19 +137,19 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                items: [this.fileTree],
                                tbar: [{
                                        iconCls: 'x-tbar-loading',
-                                       tooltip: TYPO3.lang.fileEditReloadFiletree,
+                                       tooltip: TYPO3.l10n.localize('fileEditReloadFiletree'),
                                        handler: function() {
                                                this.fileTree.getRootNode().reload();
                                        },
                                        scope: this
                                }, {
                                        iconCls: 'x-btn-upload',
-                                       tooltip: TYPO3.lang.cmd_upload,
+                                       tooltip: TYPO3.l10n.localize('cmd_upload'),
                                        ref: '../uploadFileButton',
                                        hidden: !this.allowedOperations.uploadFile
                                }, '-', {
                                        iconCls: 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-download',
-                                       tooltip: TYPO3.lang.cmd_download,
+                                       tooltip: TYPO3.l10n.localize('cmd_download'),
                                        ref: '../downloadFileButton',
                                        disabled: true,
                                        hidden: !this.allowedOperations.downloadFile,
@@ -162,7 +162,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                        scope: this
                                }, {
                                        iconCls: 't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new',
-                                       tooltip: TYPO3.lang.fileEditCreateFileFolder,
+                                       tooltip: TYPO3.l10n.localize('fileEditCreateFileFolder'),
                                        ref: '../createFileButton',
                                        disabled: true,
                                        hidden: !this.allowedOperations.createFile,
@@ -175,14 +175,14 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                        }
                                }, {
                                        iconCls: 't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-rename',
-                                       tooltip: TYPO3.lang.fileEditRename,
+                                       tooltip: TYPO3.l10n.localize('fileEditRename'),
                                        ref: '../renameButton',
                                        scope: this,
                                        hidden: !this.allowedOperations.renameFile,
                                        handler: function() {
                                                var node = this.fileTree.getSelectionModel().getSelectedNode();
                                                var isFolder = !node.isLeaf();
-                                               Ext.Msg.prompt(TYPO3.lang.fileEditRename, '', function(btn, text) {
+                                               Ext.Msg.prompt(TYPO3.l10n.localize('fileEditRename'), '', function(btn, text) {
                                                        if (btn == 'ok' && text != node.text) {
                                                                TYPO3.EM.ExtDirect.renameFile(node.attributes.id, text, isFolder, function(response) {
                                                                        if (response.success) {
@@ -197,14 +197,14 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                        }
                                }, {
                                        iconCls: 't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-delete',
-                                       tooltip: TYPO3.lang.ext_details_delete,
+                                       tooltip: TYPO3.l10n.localize('ext_details_delete'),
                                        ref: '../deleteButton',
                                        hidden: !this.allowedOperations.deleteFile,
                                        scope: this,
                                        handler: function() {
                                                var node = this.fileTree.getSelectionModel().getSelectedNode();
                                                var isFolder = !node.isLeaf();
-                                               Ext.Msg.confirm(TYPO3.lang.ext_details_delete, '', function(btn, text) {
+                                               Ext.Msg.confirm(TYPO3.l10n.localize('ext_details_delete'), '', function(btn, text) {
                                                        if (btn == 'yes') {
                                                                TYPO3.EM.ExtDirect.deleteFile(node.attributes.id, isFolder, function(response) {
                                                                        if (response.success) {
@@ -227,7 +227,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                items: [this.highlightEditor],
                                tbar: [{
                                        iconCls: 'x-btn-filebrowser',
-                                       tooltip: TYPO3.lang.cmd_openInNewWindow,
+                                       tooltip: TYPO3.l10n.localize('cmd_openInNewWindow'),
                                        ref: '../openWindowButton',
                                        scope: this,
                                        hidden: this.isWindow || this.noWindowOpen,
@@ -253,7 +253,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                         hidden: this.isWindow
                                 }, {
                                        iconCls: 'x-tbar-loading',
-                                       tooltip: TYPO3.lang.cmd_reloadFile,
+                                       tooltip: TYPO3.l10n.localize('cmd_reloadFile'),
                                        ref: '../reloadButton',
                                        scope: this,
                                        hidden: true,
@@ -268,7 +268,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                        }
                                }, {
                                        iconCls: 'x-btn-save',
-                                       tooltip: TYPO3.settings.EM.fileAllowSave ? TYPO3.lang.cmd_save : TYPO3.lang.ext_details_saving_disabled,
+                                       tooltip: TYPO3.settings.EM.fileAllowSave ? TYPO3.l10n.localize('cmd_save') : TYPO3.l10n.localize('ext_details_saving_disabled'),
                                        ref: '../saveButton',
                                        disabled: true,
                                        scope: this,
@@ -286,7 +286,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                },
                                {
                                        iconCls: 'x-btn-undo',
-                                       tooltip: TYPO3.lang.cmd_undo,
+                                       tooltip: TYPO3.l10n.localize('cmd_undo'),
                                        ref: '../undoButton',
                                        disabled: true,
                                        scope: this,
@@ -296,7 +296,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                },
                                {
                                        iconCls: 'x-btn-redo',
-                                       tooltip: TYPO3.lang.cmd_redo,
+                                       tooltip: TYPO3.l10n.localize('cmd_redo'),
                                        ref: '../redoButton',
                                        disabled: true,
                                        scope: this,
@@ -306,7 +306,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                },
                                {
                                        iconCls: 'x-btn-indent',
-                                       tooltip: TYPO3.lang.cmd_indent,
+                                       tooltip: TYPO3.l10n.localize('cmd_indent'),
                                        ref: '../indentButton',
                                        disabled: true,
                                        scope: this,
@@ -316,7 +316,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                },
                                {
                                        iconCls: 'x-btn-jslint',
-                                       tooltip: TYPO3.lang.cmd_jslint,
+                                       tooltip: TYPO3.l10n.localize('cmd_jslint'),
                                        ref: '../jslintButton',
                                        disabled: true,
                                        scope: this,
@@ -334,7 +334,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                                                oStore.loadData(aErrorData, false);
                                                        } else {
                                                                oStore.loadData([
-                                                                       [1, 1, TYPO3.lang.msg_congratsNoErrors]
+                                                                       [1, 1, TYPO3.l10n.localize('msg_congratsNoErrors')]
                                                                ], false);
                                                        }
                                                        this.highlightEditor.debugWindow.show();
@@ -347,7 +347,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                        xtype: 'tbtext',
                                        ref: '../fileLabel',
                                        itemId: 'editarea-filename',
-                                       text: TYPO3.lang.help_loadFileInEditor
+                                       text: TYPO3.l10n.localize('help_loadFileInEditor')
                                }]
                        }]
                });
@@ -368,7 +368,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                if (node.attributes.fileType === 'text') {
                        var file = node.attributes.id;
                        if (this.highlightEditor.contentChanged) {
-                                Ext.MessageBox.confirm(TYPO3.lang.fileEditFileChanged, TYPO3.lang.fileEditFileChangedSavePrompt, function(btn){
+                                Ext.MessageBox.confirm(TYPO3.l10n.localize('fileEditFileChanged'), TYPO3.l10n.localize('fileEditFileChangedSavePrompt'), function(btn){
                                        if (btn == 'yes'){
                                                this.saveFile(this.highlightEditor.editFile, function() {
                                                        this.loadFile(node);
@@ -440,11 +440,11 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                        content,
                        function(response) {
                                if (response.success) {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.lang.cmd_save, String.format(TYPO3.lang.msg_fileSaved, response.file), 5);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.l10n.localize('cmd_save'), String.format(TYPO3.l10n.localize('msg_fileSaved'), response.file), 5);
                                        this.highlightEditor.contentChanged = false;
                                        this.layout.center.panel.fileLabel.removeClass('fileChanged');
                                } else {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.cmd_save, response.error, 5);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('cmd_save'), response.error, 5);
                                }
                                if (Ext.isFunction(cb)) {
                                        cb.call(this);
@@ -526,24 +526,24 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
        fileCreationDialog: function(folderNode) {
                new Ext.Window({
                        id: 'em-files-createfilefolderdialog',
-                       title: TYPO3.lang.fileEditCreateFileFolder,
+                       title: TYPO3.l10n.localize('fileEditCreateFileFolder'),
                        layout: 'form',
                        callerClass: this,
                        items: [
                                {
-                                       fieldLabel:  TYPO3.lang.fileEditNewFilePrompt,
+                                       fieldLabel:  TYPO3.l10n.localize('fileEditNewFilePrompt'),
                                        itemId: 'newfile',
                                        xtype: 'textfield',
                                        width: 250
                                },
                                {
-                                       fieldLabel: TYPO3.lang.fileEditCreateFolder,
+                                       fieldLabel: TYPO3.l10n.localize('fileEditCreateFolder'),
                                        xtype: 'checkbox',
                                        itemId: 'isFolder'
                                }
                        ],
                        buttons: [{
-                               text: TYPO3.lang.cmd_create,
+                               text: TYPO3.l10n.localize('cmd_create'),
                                handler: function() {
                                        var me = Ext.WindowMgr.get('em-files-createfilefolderdialog');
                                        var newfile = me.getComponent('newfile').getValue();
@@ -575,7 +575,7 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
                                },
                                scope: this
                        }, {
-                               text: TYPO3.lang.cmd_cancel,
+                               text: TYPO3.l10n.localize('cmd_cancel'),
                                handler: function() {
                                        var me = TYPO3.Windows.getById('em-files-createfilefolderdialog');
                                        me.close();
@@ -605,7 +605,7 @@ TYPO3.EM.CodeMirror = Ext.extend(Ext.Panel, {
                this.contentChanged = false;
                var me = this;
                this.debugWindow = new Ext.Window({
-                       title: TYPO3.lang.msg_debug,
+                       title: TYPO3.l10n.localize('msg_debug'),
                        width: 500,
                        layout: 'border',
                        closeAction: 'hide',
@@ -635,7 +635,7 @@ TYPO3.EM.CodeMirror = Ext.extend(Ext.Panel, {
                                columns: [
                                        {
                                                id: 'line',
-                                               header: TYPO3.lang.msg_line,
+                                               header: TYPO3.l10n.localize('msg_line'),
                                                width: 40,
                                                fixed: true,
                                                menuDisabled: true,
@@ -643,14 +643,14 @@ TYPO3.EM.CodeMirror = Ext.extend(Ext.Panel, {
                                        },
                                        {
                                                id: 'character',
-                                               header: TYPO3.lang.msg_character,
+                                               header: TYPO3.l10n.localize('msg_character'),
                                                width: 70,
                                                fixed: true,
                                                menuDisabled: true,
                                                dataIndex: 'character'
                                        },
                                        {
-                                               header: TYPO3.lang.show_description,
+                                               header: TYPO3.l10n.localize('show_description'),
                                                menuDisabled: true,
                                                dataIndex: 'reason'
                                        }
index 36de6e1..e75030b 100644 (file)
@@ -57,7 +57,7 @@ Ext.grid.DynamicColumnModelForLanguages = function(store){
                                hidable: false,
                                menuDisabled: true,
                                renderer: function(value, metaData, record, rowIndex, colIndex, store) {
-                                       if (value == TYPO3.lang.translation_checking) {
+                                       if (value == TYPO3.l10n.localize('translation_checking')) {
                                                return '<span class="x-mask-loading">&nbsp;</span>' + value;
                                        }
                                        return '<span class="x-mask-loading">&nbsp;</span>' + value;;
@@ -82,7 +82,7 @@ TYPO3.EM.LanguagesSelectionModel  = new Ext.grid.CheckboxSelectionModel({
 TYPO3.EM.LanguagesColumnModel = new Ext.grid.ColumnModel([
        TYPO3.EM.LanguagesSelectionModel, {
                id: 'lang-label',
-               header: TYPO3.lang.lang_language,
+               header: TYPO3.l10n.localize('lang_language'),
                sortable: true,
                menuDisabled: true,
                dataIndex: 'label',
@@ -92,7 +92,7 @@ TYPO3.EM.LanguagesColumnModel = new Ext.grid.ColumnModel([
                }
        },{
                id: 'lang-key',
-               header: TYPO3.lang.lang_short,
+               header: TYPO3.l10n.localize('lang_short'),
                menuDisabled: true,
                sortable: true,
                dataIndex: 'lang',
@@ -225,12 +225,12 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                                        },
                                                        items: [{
                                                                xtype: 'button',
-                                                               text: TYPO3.lang.translation_check_status_button,
+                                                               text: TYPO3.l10n.localize('translation_check_status_button'),
                                                                id: 'lang-checkbutton',
                                                                margins: '0 10 10 0'
                                                        }, {
                                                                xtype: 'button',
-                                                               text: TYPO3.lang.translation_update_button,
+                                                               text: TYPO3.l10n.localize('translation_update_button'),
                                                                id: 'lang-updatebutton',
                                                                margins: '0 0 10 10'
                                                        }]
@@ -241,7 +241,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                                        id: 'em-extlanguagegrid',
                                                        stripeRows: true,
                                                        store: langExtStore,
-                                                       loadMask: {msg: TYPO3.lang.translation_refresh_languages},
+                                                       loadMask: {msg: TYPO3.l10n.localize('translation_refresh_languages')},
                                                        enableColumnMove: false,
                                                        enableHdMenu : false,
                                                        autoheight: true,
@@ -274,13 +274,13 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                var record = grid.store.getAt(rowIndex);
                                var lang = grid.colModel.config[columnIndex].dataIndex;
                                Ext.Msg.confirm(
-                                       TYPO3.lang.menu_language_packges,
-                                       String.format(TYPO3.lang.translation_singleCheckQuestion, lang, '<strong>' + record.data.extkey + '</strong>'),
+                                       TYPO3.l10n.localize('menu_language_packges'),
+                                       String.format(TYPO3.l10n.localize('translation_singleCheckQuestion'), lang, '<strong>' + record.data.extkey + '</strong>'),
                                        function(btn) {
                                                if (btn === 'yes') {
                                                        this.waitBox = Ext.Msg.wait(
-                                                               String.format(TYPO3.lang.translation_singleCheck, lang, '<strong>' + record.data.extkey + '</strong>'),
-                                                               TYPO3.lang.translation_checking
+                                                               String.format(TYPO3.l10n.localize('translation_singleCheck'), lang, '<strong>' + record.data.extkey + '</strong>'),
+                                                               TYPO3.l10n.localize('translation_checking')
                                                        );
                                                        TYPO3.EM.ExtDirect.fetchTranslations(record.data.extkey, 1, [lang], function(response) {
                                                                record.set(lang, response[lang]);
@@ -309,7 +309,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                if (button.id === 'lang-checkbutton') {
                                // check languages
                        this.startFetchLanguages(0, Ext.StoreMgr.get('em-languageext-store'), function(){
-                               TYPO3.EM.LanguagesProgressBar.updateText(this.interruptProcess ? TYPO3.lang.msg_interrupted : TYPO3.lang.msg_finished);
+                               TYPO3.EM.LanguagesProgressBar.updateText(this.interruptProcess ? TYPO3.l10n.localize('msg_interrupted') : TYPO3.l10n.localize('msg_finished'));
                                (function() {
                                        progressBar.hide();
                                        buttonPanel.show();
@@ -317,16 +317,16 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                        grid.fetchingProcess = false;
                                }).defer(1000, this);
                                if (!this.interruptProcess) {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.translation_checking_extension, TYPO3.lang.translation_check_done, 3);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('translation_checking_extension'), TYPO3.l10n.localize('translation_check_done'), 3);
                                        Ext.getCmp('em-extlanguagegrid').getSelectionModel().clearSelections();
                                }
                        });
                } else {
                                // update languages
                        this.startFetchLanguages(1, Ext.StoreMgr.get('em-languageext-store'), function(){
-                               TYPO3.EM.LanguagesProgressBar.updateText(this.interruptProcess ? TYPO3.lang.msg_interrupted : TYPO3.lang.msg_finished);
+                               TYPO3.EM.LanguagesProgressBar.updateText(this.interruptProcess ? TYPO3.l10n.localize('msg_interrupted') : TYPO3.l10n.localize('msg_finished'));
                                if (!this.interruptProcess) {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.translation_update_extension, TYPO3.lang.translation_update_done, 3);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('translation_update_extension'), TYPO3.l10n.localize('translation_update_done'), 3);
                                        Ext.getCmp('em-extlanguagegrid').getSelectionModel().clearSelections();
                                }
                                progressBar.hide();
@@ -408,18 +408,18 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                        grid.getView().focusRow(row);
                        grid.getSelectionModel().selectRow(row);
                        for (i = 0; i < this.selectedLanguages.length; i++) {
-                               record.set(this.selectedLanguages[i], '<span class="loading-indicator"></span>' + TYPO3.lang.translation_checking);
+                               record.set(this.selectedLanguages[i], '<span class="loading-indicator"></span>' + TYPO3.l10n.localize('translation_checking'));
                        }
                        record.commit();
-                       var prefix = TYPO3.lang.msg_checking;
+                       var prefix = TYPO3.l10n.localize('msg_checking');
                        if (this.fetchType === 1) {
-                               prefix = TYPO3.lang.msg_updating;
+                               prefix = TYPO3.l10n.localize('msg_updating');
                        }
                        // update Progressbar
                        Ext.getCmp('langpb').updateProgress(
                                (row + 1) / this.extCount,
                                prefix+ ': ' +
-                                       String.format(TYPO3.lang.translation_fetch_extension, ext, (row+1), this.extCount));
+                                       String.format(TYPO3.l10n.localize('translation_fetch_extension'), ext, (row+1), this.extCount));
 
                        // fetch language request
                        TYPO3.EM.ExtDirect.fetchTranslations(ext, this.fetchType, this.selectedLanguages, function(response) {
@@ -460,13 +460,13 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                if (index === -1) {
                        extLangGrid.addColumn({
                                name: record.lang,
-                               defaultValue: TYPO3.lang.translation_status_notchecked
+                               defaultValue: TYPO3.l10n.localize('translation_status_notchecked')
                        }, {
                                header: '<span class="' + record.cls + '">&nbsp</span>' + record.label,
                                dataIndex: record.lang,
                                id: record.lang,
                                css: 'cursor:pointer;',
-                               tooltip: TYPO3.lang.translation_singleCheckTip
+                               tooltip: TYPO3.l10n.localize('translation_singleCheckTip')
                        });
                } else {
                        columns.removeColumn(index);
index 8a62972..ab5cc06 100644 (file)
@@ -41,34 +41,34 @@ TYPO3.EM.Layouts = {
                                '<p class="desc">{description}</p>',
                                '<div class="em-extlist-extinfo-sub">',
                                        '<div class="em-extlist-extinfo-left">',
-                                               '<h3>' + TYPO3.lang.show_details + '</h3>',
-                                               '<p><label>' + TYPO3.lang.extInfoArray_author + ':</label> {author}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_version + ':</label> {version}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_category + ':</label> {category}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_state + ':</label> {state}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_shy + ':</label> {shyword}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_internal + ':</label> {internal}<br />',
-                                               '<label>' + TYPO3.lang.ext_details_doNotLoadInFE + ':</label> {[this.loadInFe(values)]}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_depends_on + ':</label> {depends}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_conflicts_with + ':</label> {conflicts}<br />',
-                                               '<label>' + TYPO3.lang.extInfoArray_suggests + ':</label> {suggests}<br />',
+                                               '<h3>' + TYPO3.l10n.localize('show_details') + '</h3>',
+                                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_author') + ':</label> {author}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_version') + ':</label> {version}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_category') + ':</label> {category}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_state') + ':</label> {state}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_shy') + ':</label> {shyword}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_internal') + ':</label> {internal}<br />',
+                                               '<label>' + TYPO3.l10n.localize('ext_details_doNotLoadInFE') + ':</label> {[this.loadInFe(values)]}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_depends_on') + ':</label> {depends}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_conflicts_with') + ':</label> {conflicts}<br />',
+                                               '<label>' + TYPO3.l10n.localize('extInfoArray_suggests') + ':</label> {suggests}<br />',
                                        '</div>',
                                        '<div class="em-extlist-extinfo-right">',
-                                               '<h3>' + TYPO3.lang.show_links + '</h3>',
-                                               '<p><label>' + TYPO3.lang.cmd_downloadext + ':</label> {download}</p> ',
+                                               '<h3>' + TYPO3.l10n.localize('show_links') + '</h3>',
+                                               '<p><label>' + TYPO3.l10n.localize('cmd_downloadext') + ':</label> {download}</p> ',
                                                '<tpl if="doc">',
-                                                       '<p><label>' + TYPO3.lang.cmd_readdoc + ':</label> {doc}</p>',
+                                                       '<p><label>' + TYPO3.l10n.localize('cmd_readdoc') + ':</label> {doc}</p>',
                                                '</tpl>',
                                                '<tpl if="updateModule">',
-                                                       '<h3>' + TYPO3.lang.cmd_update + '</h3>',
-                                                       '<p><a href="#" id="update-check-{extkey}" class="update-check-link">' + TYPO3.lang.ext_details_checkUpdateScript + '</a></p>',
+                                                       '<h3>' + TYPO3.l10n.localize('cmd_update') + '</h3>',
+                                                       '<p><a href="#" id="update-check-{extkey}" class="update-check-link">' + TYPO3.l10n.localize('ext_details_checkUpdateScript') + '</a></p>',
                                                '</tpl>',
                                        '</div>',
                                '</div>',
                        '</div>',
                        {
                                loadInFe: function(values) {
-                                       return values.doNotLoadInFE ? TYPO3.lang.no : TYPO3.lang.yes;
+                                       return values.doNotLoadInFE ? TYPO3.l10n.localize('no') : TYPO3.l10n.localize('yes');
                                }
                        }
                );
@@ -77,18 +77,18 @@ TYPO3.EM.Layouts = {
        remoteExtensionInfo: function() {
                return new Ext.XTemplate(
                        '<div class="em-info">',
-                               '<p><label>' + TYPO3.lang.extInfoArray_title + ':' +
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_title') + ':' +
                                                '</label><a href="http://typo3.org/extensions/repository/view/{extkey}/current/" target="_blank" title="'
-                                               + TYPO3.lang.cmd_viewOnline + '">{title}</a></p>',
-                               '<p><label>' + TYPO3.lang.listRowHeader_ext_key + '</label>{extkey}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_category + ':</label>{[TYPO3.EM.App.getCategoryLabel(values.category)]}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_version + ':</label>{version}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_downloads + ':</label>{alldownloadcounter} / {downloadcounter}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_lastUpdate + ':</label>{lastuploaddate:this.getDateFormat}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_state + ':</label>{state}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_author + ':</label>{[this.getAuthor(values)]}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_versions + ':</label>{versions}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_description + ':</label>{description:this.getDescription}</p>',
+                                               + TYPO3.l10n.localize('cmd_viewOnline') + '">{title}</a></p>',
+                               '<p><label>' + TYPO3.l10n.localize('listRowHeader_ext_key') + '</label>{extkey}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_category') + ':</label>{[TYPO3.EM.App.getCategoryLabel(values.category)]}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_version') + ':</label>{version}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_downloads') + ':</label>{alldownloadcounter} / {downloadcounter}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_lastUpdate') + ':</label>{lastuploaddate:this.getDateFormat}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_state') + ':</label>{state}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_author') + ':</label>{[this.getAuthor(values)]}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_versions') + ':</label>{versions}</p>',
+                               '<p><label>' + TYPO3.l10n.localize('extInfoArray_description') + ':</label>{description:this.getDescription}</p>',
                        '</div>',
                {
                        getDescription: function(value) {
@@ -111,12 +111,12 @@ TYPO3.EM.Layouts = {
        getExtensionRules: function() {
                return [
                        '<div class="extvalidinfo">',
-                               '<b>' + TYPO3.lang.registerkeys_rules_heading + '</b>',
+                               '<b>' + TYPO3.l10n.localize('registerkeys_rules_heading') + '</b>',
                                '<ul>',
-                                       '<li>' + TYPO3.lang.registerkeys_rules_allowedcharacters + '</li>',
-                                       '<li>' + TYPO3.lang.registerkeys_rules_prefixes + '</li>',
-                                       '<li>' + TYPO3.lang.registerkeys_rules_startandend + '</li>',
-                                       '<li>' + TYPO3.lang.registerkeys_rules_length + '</li>',
+                                       '<li>' + TYPO3.l10n.localize('registerkeys_rules_allowedcharacters') + '</li>',
+                                       '<li>' + TYPO3.l10n.localize('registerkeys_rules_prefixes') + '</li>',
+                                       '<li>' + TYPO3.l10n.localize('registerkeys_rules_startandend') + '</li>',
+                                       '<li>' + TYPO3.l10n.localize('registerkeys_rules_length') + '</li>',
                                '</ul>',
                        '</div>'
                ].join('');
@@ -124,13 +124,13 @@ TYPO3.EM.Layouts = {
        repositoryInfo: function() {
                return new Ext.XTemplate(
                        '<span class="typo3-message message-notice" ',
-                       'qtip="{updated:this.updatedFormat}<br>' + TYPO3.lang.extensions_repository_short + ' {count}">',
+                       'qtip="{updated:this.updatedFormat}<br>' + TYPO3.l10n.localize('extensions_repository_short') + ' {count}">',
                        '{updated:this.updatedFormat}&nbsp;&nbsp;',
-                       TYPO3.lang.extensions_repository_short + ' {count}',
+                       TYPO3.l10n.localize('extensions_repository_short') + ' {count}',
                        '</span>',
                        {
                                updatedFormat: function(value) {
-                                       return TYPO3.lang.ext_list_last_updated.replace('%s', value).replace('(', '').replace(')', '');
+                                       return TYPO3.l10n.localize('ext_list_last_updated').replace('%s', value).replace('(', '').replace(')', '');
                                }
                        }
                );
index 668a5c0..019f6d1 100644 (file)
@@ -59,7 +59,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                        record: record,
                                        items:[
                                                {
-                                                       title: TYPO3.lang.msg_info,
+                                                       title: TYPO3.l10n.localize('msg_info'),
                                                        html: TYPO3.EM.Layouts.showExtInfo(record.data),
                                                        listeners: {
                                                                activate: function(panel) {
@@ -74,7 +74,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                                                                                                width: 500,
                                                                                                                                height: 500,
                                                                                                                                layout: 'fit',
-                                                                                                                               title: TYPO3.lang.ext_details_updateScript + ' (' + record.data.extkey + ')',
+                                                                                                                               title: TYPO3.l10n.localize('ext_details_updateScript') + ' (' + record.data.extkey + ')',
                                                                                                                                items: [
                                                                                                                                        {
                                                                                                                                                xtype: 'iframePanel',
@@ -85,7 +85,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                                                                                Ext.getCmp('updateScript-' + record.data.extkey).setUrl('mod.php?M=tools_em&nodoc=1&CMD[showExt]=' + record.data.extkey + '&SET[singleDetails]=updateModule');
                                                                                                        });
                                                                                                } else {
-                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.cmd_update, TYPO3.lang.repository_update_not_needed, 5);
+                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('cmd_update'), TYPO3.l10n.localize('repository_update_not_needed'), 5);
                                                                                                }
                                                                                        });
                                                                                }, this);
@@ -95,7 +95,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        }
                                                },
                                                {
-                                                       title: TYPO3.lang.msg_dbupdate,
+                                                       title: TYPO3.l10n.localize('msg_dbupdate'),
                                                        html: TYPO3.EM.App.loadingIndicor,
                                                        xtype: 'form',
                                                        disabled: record.data.installed === 0,
@@ -124,7 +124,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        },
                                                        doUpdate: function(noSave) {
                                                                this.form.submit({
-                                                                                       waitMsg : noSave ? ' ' : TYPO3.lang.action_updateDatabase,
+                                                                                       waitMsg : noSave ? ' ' : TYPO3.l10n.localize('action_updateDatabase'),
                                                                                        params: {
                                                                                                extkey: record.data.extkey,
                                                                                                exttype: record.data.typeShort,
@@ -138,13 +138,13 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                                                        },
                                                                                        failure: function(form, action) {
                                                                                                if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                                                                                       TYPO3.lang.msg_error + ':' + action.response.status + ': ' +
+                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                                                                                       TYPO3.l10n.localize('msg_error') + ':' + action.response.status + ': ' +
                                                                                                                                        action.response.statusText, 5);
                                                                                                }
                                                                                                if (action.failureType === Ext.form.Action.SERVER_INVALID) {
                                                                                                        // server responded with success = false
-                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.invalid, action.result.errormsg, 5);
+                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('invalid'), action.result.errormsg, 5);
                                                                                                }
                                                                                        },
                                                                                        scope: this
@@ -152,7 +152,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        }
                                                },
                                                {
-                                                       title: TYPO3.lang.msg_configuration,
+                                                       title: TYPO3.l10n.localize('msg_configuration'),
                                                        xtype: 'form',
                                                        disabled: record.data.installed === 0,
                                                        html: TYPO3.EM.App.loadingIndicor,
@@ -200,7 +200,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        },
                                                        doSubmit: function(noSave) {
                                                                this.form.submit({
-                                                                                       waitMsg : noSave ? ' ' : TYPO3.lang.action_saving_settings,
+                                                                                       waitMsg : noSave ? ' ' : TYPO3.l10n.localize('action_saving_settings'),
                                                                                        params: {
                                                                                                extkey: record.data.extkey,
                                                                                                exttype: record.data.typeShort,
@@ -210,18 +210,18 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                                                                if (action.result.html) {
                                                                                                        this.ownerCt.activeTab.update(action.result.html, true, this.readConfigForm.createDelegate(this));
                                                                                                } else {
-                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.lang.msg_configuration, TYPO3.lang.configurationSaved, 5);
+                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.l10n.localize('msg_configuration'), TYPO3.l10n.localize('configurationSaved'), 5);
                                                                                                }
                                                                                        },
                                                                                        failure: function(form, action) {
                                                                                                if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                                                                                       TYPO3.lang.msg_error + ':' + action.response.status + ': ' +
+                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                                                                                       TYPO3.l10n.localize('msg_error') + ':' + action.response.status + ': ' +
                                                                                                                                        action.response.statusText, 5);
                                                                                                }
                                                                                                if (action.failureType === Ext.form.Action.SERVER_INVALID) {
                                                                                                        // server responded with success = false
-                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.invalid, action.result.errormsg, 5);
+                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('invalid'), action.result.errormsg, 5);
                                                                                                }
                                                                                        },
                                                                                        scope: this
@@ -229,20 +229,20 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        }
                                                },
                                                {
-                                                       title: TYPO3.lang.msg_files,
+                                                       title: TYPO3.l10n.localize('msg_files'),
                                                        xtype: 'extfilelist',
                                                        recordData: record.data,
                                                        cls: 'gridrowfilespanel'
                                                },
                                                {
                                                        xtype: 'terupload',
-                                                       title: TYPO3.lang.cmd_terupload,
+                                                       title: TYPO3.l10n.localize('cmd_terupload'),
                                                        recordData: record.data,
                                                        disabled: !TYPO3.settings.EM.hasCredentials
                                                },
                                                {
-                                                       title: TYPO3.lang.msg_developerinformation,
-                                                       html: '<div class="loading-indicator">' + TYPO3.lang.action_loading + '</div>',
+                                                       title: TYPO3.l10n.localize('msg_developerinformation'),
+                                                       html: '<div class="loading-indicator">' + TYPO3.l10n.localize('action_loading') + '</div>',
                                                        listeners: {
                                                                activate: function(panel) {
                                                                        TYPO3.EM.ExtDirect.getExtensionDevelopInfo(record.data.extkey, function(response) {
@@ -252,7 +252,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        }
                                                },
                                                {
-                                                       title: TYPO3.lang.details_maintenance,
+                                                       title: TYPO3.l10n.localize('details_maintenance'),
                                                        html: TYPO3.EM.App.loadingIndicor,
                                                        listeners: {
                                                                activate: function(panel) {
@@ -268,10 +268,10 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                                        var link = emconflink.elements[0];
                                                                        link.removeAttribute('onclick');
                                                                        Ext.get(link).on('click', function() {
-                                                                               this.waitBox = Ext.Msg.wait(TYPO3.lang.ext_details_update_em_conf, record.data.extkey);
+                                                                               this.waitBox = Ext.Msg.wait(TYPO3.l10n.localize('ext_details_update_em_conf'), record.data.extkey);
                                                                                TYPO3.EM.ExtDirect.cleanEmConf(record.data.extkey, function(response) {
                                                                                        this.waitBox.hide();
-                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.lang.ext_details_update_em_conf, response.result, 5);
+                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.l10n.localize('ext_details_update_em_conf'), response.result, 5);
                                                                                }, this);
                                                                        });
                                                                }
@@ -280,11 +280,11 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                                        var link = deletelink.elements[0];
                                                                        link.removeAttribute('onclick');
                                                                        Ext.get(link).on('click', function() {
-                                                                               this.waitBox = Ext.Msg.wait(TYPO3.lang.extDelete_from_server, record.data.extkey);
+                                                                               this.waitBox = Ext.Msg.wait(TYPO3.l10n.localize('extDelete_from_server'), record.data.extkey);
                                                                                TYPO3.EM.ExtDirect.deleteExtension(record.data.extkey, function(response) {
                                                                                        this.waitBox.hide();
                                                                                        if (response.success) {
-                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.lang.msg_extkexDeletedSuccess, response.result, 5);
+                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.l10n.localize('msg_extkexDeletedSuccess'), response.result, 5);
                                                                                                Ext.StoreMgr.get('localstore').remove(record);
                                                                                        } else {
                                                                                                TYPO3.Flashmessage.display(TYPO3.Severity.error, response.error, response.result, 5);
@@ -357,7 +357,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
 
                                },
                                datachanged: function(store) {
-                                       Ext.getCmp('displayExtensionLabel').setText(TYPO3.lang.extensions + ' ' + store.data.length);
+                                       Ext.getCmp('displayExtensionLabel').setText(TYPO3.l10n.localize('extensions') + ' ' + store.data.length);
                                        var hasFilters = store.hasStoreFilter();
                                        TYPO3.EM.Filters.filters.each(function (filter) {
                                                if (filter.active) {
@@ -477,8 +477,8 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
 
                Ext.apply(this, {
                        itemId: 'em-localLocalExtensionlist',
-                       title: TYPO3.lang.localExtensionList,
-                       loadMask: {msg: TYPO3.lang.action_loading_extlist},
+                       title: TYPO3.l10n.localize('localExtensionList'),
+                       loadMask: {msg: TYPO3.l10n.localize('action_loading_extlist')},
                        layout: 'fit',
                        store: this.localstore,
                        cm: cm,
@@ -486,7 +486,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                        plugins: TYPO3.settings.EM.inlineToWindow == 1 ? [TYPO3.EM.Filters] : [this.rowExpander, TYPO3.EM.Filters],
                        view : new Ext.grid.GroupingView({
                                                forceFit : true,
-                                               groupTextTpl : '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "' + TYPO3.lang.msg_items + '" : "' + TYPO3.lang.msg_item + '"]})',
+                                               groupTextTpl : '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "' + TYPO3.l10n.localize('msg_items') + '" : "' + TYPO3.l10n.localize('msg_item') + '"]})',
                                                enableRowBody: true,
                                                showPreview: true,
                                                getRowClass: this.applyRowClass,
@@ -497,8 +497,8 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                        tbar: [
                                ' ',
                                {
-                                       text: TYPO3.lang.cmd_filter,
-                                       tooltip: TYPO3.lang.help_localFilter,
+                                       text: TYPO3.l10n.localize('cmd_filter'),
+                                       tooltip: TYPO3.l10n.localize('help_localFilter'),
                                        tooltipType : 'qtip',
                                        scale: 'small',
                                        ref: '../filterMenuButton',
@@ -507,7 +507,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                items: [
                                                        {
                                                                checked: TYPO3.settings.EM.display_installed ? true : false,
-                                                               text: TYPO3.lang.display_installedOnly,
+                                                               text: TYPO3.l10n.localize('display_installedOnly'),
                                                                handler: function(item, event) {
                                                                        TYPO3.settings.EM.display_installed = item.checked ? 0 : 1;
                                                                        TYPO3.EM.ExtDirect.saveSetting('display_installed', TYPO3.settings.EM.display_installed);
@@ -517,7 +517,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        },
                                                        {
                                                                checked: TYPO3.settings.EM.hide_shy ? true : false,
-                                                               text: TYPO3.lang.hide_shy,
+                                                               text: TYPO3.l10n.localize('hide_shy'),
                                                                handler: function(item, event) {
                                                                        TYPO3.settings.EM.hide_shy = item.checked ? 0 : 1;
                                                                        TYPO3.EM.ExtDirect.saveSetting('hide_shy', TYPO3.settings.EM.hide_shy);
@@ -527,7 +527,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        },
                                                        {
                                                                checked: TYPO3.settings.EM.hide_obsolete ? true : false,
-                                                               text: TYPO3.lang.hide_obsolete,
+                                                               text: TYPO3.l10n.localize('hide_obsolete'),
                                                                handler: function(item, event) {
                                                                        TYPO3.settings.EM.hide_obsolete = item.checked ? 0 : 1;
                                                                        TYPO3.EM.ExtDirect.saveSetting('hide_obsolete', TYPO3.settings.EM.hide_obsolete);
@@ -544,7 +544,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                        ref: '../doClearFiltersSeperator',
                                        hidden: true
                                }, {
-                                       text: TYPO3.lang.cmd_ClearAllFilters,
+                                       text: TYPO3.l10n.localize('cmd_ClearAllFilters'),
                                        ref: '../doClearFilters',
                                        handler: function() {
                                                this.localstore.clearStoreFilters(this);
@@ -556,7 +556,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                '-',
                                {
                                        iconCls: 't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-upload',
-                                       tooltip: TYPO3.lang.upload_ext_directly,
+                                       tooltip: TYPO3.l10n.localize('upload_ext_directly'),
                                        ref: '../uploadButton',
                                        handler: function() {
                                                TYPO3.EM.Tools.uploadExtension();
@@ -566,7 +566,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                '->',
                                {
                                        xtype: 'tbtext',
-                                       text: TYPO3.lang.action_loading_extlist,
+                                       text: TYPO3.l10n.localize('action_loading_extlist'),
                                        id: 'displayExtensionLabel',
                                        style: {fontWeight: 'bold'}
                                },
index 85c964b..6f35e4d 100644 (file)
@@ -54,7 +54,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                        record: record,
                                        items:[
                                                {
-                                                       title: TYPO3.lang.details_info,
+                                                       title: TYPO3.l10n.localize('details_info'),
                                                        listeners: {
                                                                activate: function(panel) {
                                                                        panel.update(TYPO3.EM.Layouts.remoteExtensionInfo().applyTemplate(panel.ownerCt.record.data));
@@ -184,7 +184,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                        store: this.repositoryListStore,
                        width: 260,
                        specialKeyOnly: true,
-                       emptyText: TYPO3.lang.msg_startTyping
+                       emptyText: TYPO3.l10n.localize('msg_startTyping')
                });
 
                var cm = new Ext.grid.ColumnModel({
@@ -208,7 +208,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                });
 
                Ext.apply(this, {
-                       loadMask: {msg: TYPO3.lang.action_loadingRepositoryExtlist},
+                       loadMask: {msg: TYPO3.l10n.localize('action_loadingRepositoryExtlist')},
                        store: this.repositoryListStore,
                        cm: cm,
                        plugins: TYPO3.settings.EM.inlineToWindow == 1 ? [TYPO3.EM.RemoteFilters] : [this.expander, TYPO3.EM.RemoteFilters],
@@ -225,8 +225,8 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                        tbar: [
                                ' ',
                                {
-                                       text: TYPO3.lang.cmd_filter,
-                                       tooltip: TYPO3.lang.help_remoteFilter,
+                                       text: TYPO3.l10n.localize('cmd_filter'),
+                                       tooltip: TYPO3.l10n.localize('help_remoteFilter'),
                                        scale: 'small',
                                        iconAlign: 'right',
                                        ref: '../filterMenuButton',
@@ -235,7 +235,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                                        {
                                                                checked: true,
                                                                group: 'installFilter',
-                                                               text: TYPO3.lang.display_all,
+                                                               text: TYPO3.l10n.localize('display_all'),
                                                                handler: function(item, event) {
                                                                        this.showInstalledOnly = 0;
                                                                        this.store.reload();
@@ -244,7 +244,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                                        }, {
                                                                checked: false,
                                                                group: 'installFilter',
-                                                               text: TYPO3.lang.display_installedOnly,
+                                                               text: TYPO3.l10n.localize('display_installedOnly'),
                                                                handler: function(item, event) {
                                                                        this.showInstalledOnly = 1;
                                                                        this.store.reload();
@@ -253,7 +253,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                                        }, {
                                                                checked: false,
                                                                group: 'installFilter',
-                                                               text: TYPO3.lang.display_updatesOnly,
+                                                               text: TYPO3.l10n.localize('display_updatesOnly'),
                                                                handler: function(item, event) {
                                                                        this.showInstalledOnly = 2;
                                                                        this.store.reload();
@@ -264,7 +264,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                        }
                                },
                                searchField, ' ', {
-                                       text: TYPO3.lang.cmd_ClearAllFilters,
+                                       text: TYPO3.l10n.localize('cmd_ClearAllFilters'),
                                        ref: '../doClearFilters',
                                        handler: function() {
                                                TYPO3.EM.RemoteFilters.clearFilters();
@@ -275,13 +275,13 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                '->',
                                {
                                        xtype: 'tbtext',
-                                       text: TYPO3.lang.repository + ': '
+                                       text: TYPO3.l10n.localize('repository') + ': '
                                },
                                TYPO3.EM.RepositoryCombo,
                                {
                                        iconCls: 'x-btn-repupdate',
                                        handler: this.repositoryUpdate,
-                                       tooltip: TYPO3.lang.cmd_RetrieveUpdate,
+                                       tooltip: TYPO3.l10n.localize('cmd_RetrieveUpdate'),
                                        scope: this,
                                        hidden: !TYPO3.settings.EM.allowRepositoryUpdate
                                },
@@ -300,7 +300,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                        store: this.repositoryListStore,
                                        pageSize: 50,
                                        displayInfo: true,
-                                       emptyMsg: TYPO3.lang.action_searching
+                                       emptyMsg: TYPO3.l10n.localize('action_searching')
                                }
                        ]
                });
@@ -318,7 +318,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                this.repositoryStore.load({
                        callback: function() {
                                if (this.getCount() == 0) {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error, TYPO3.lang.repository_notfound, 15);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'), TYPO3.l10n.localize('repository_notfound'), 15);
                                } else {
                                        var rec = this.getById(TYPO3.settings.EM.selectedRepository);
                                        if (!rec) {
@@ -340,15 +340,15 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                        var menu = new Ext.menu.Menu({
                                                record: record,
                                                items: [{
-                                                       text: String.format(TYPO3.lang.ext_import_versions, record.data.title)
-                                                               + ' (' + String.format(TYPO3.lang.ext_import_versions_available, record.data.versions) + ')',
+                                                       text: String.format(TYPO3.l10n.localize('ext_import_versions'), record.data.title)
+                                                               + ' (' + String.format(TYPO3.l10n.localize('ext_import_versions_available'), record.data.versions) + ')',
                                                        iconCls: 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-import',
                                                        handler: function() {
                                                                var record = this.ownerCt.record.data;
                                                                var link = TYPO3.settings.EM.scriptLink
                                                                        + '&nodoc=1&ter_connect=1&ter_search=' + record.extkey  +'&CMD[importExtInfo]=' + record.extkey;
                                                                TYPO3.EM.ImportWindow = new TYPO3.EM.InstallWindow({
-                                                                       title: String.format(TYPO3.lang.ext_import_versions, record.title) + ' (' + record.extkey + ')',
+                                                                       title: String.format(TYPO3.l10n.localize('ext_import_versions'), record.title) + ' (' + record.extkey + ')',
                                                                        record: record,
                                                                        installAction: 'import',
                                                                        listeners: {
@@ -380,7 +380,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
        },
 
        repositoryUpdate: function() {
-               var m = Ext.MessageBox.wait(TYPO3.lang.msg_longwait, TYPO3.lang.repository_update);
+               var m = Ext.MessageBox.wait(TYPO3.l10n.localize('msg_longwait'), TYPO3.l10n.localize('repository_update'));
                var index = TYPO3.EM.RepositoryCombo.getValue();
                if (!index) {
                        return;
@@ -389,12 +389,12 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                TYPO3.EM.ExtDirect.repositoryUpdate(index, function(response) {
                        if (!response.success) {
                                if (response.rep == 0) {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error, response.errormsg, 15);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'), response.errormsg, 15);
                                } else {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.notice, TYPO3.lang.repository_update_not_needed, response.errormsg, 5);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.notice, TYPO3.l10n.localize('repository_update_not_needed'), response.errormsg, 5);
                                }
                        } else {
-                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.repository_updated, String.format(TYPO3.lang.repository_extensions_count, response.data.count), 10);
+                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('repository_updated'), String.format(TYPO3.l10n.localize('repository_extensions_count'), response.data.count), 10);
                                record.set('count', response.data.count);
                                record.set('updated', response.data.updated);
                                Ext.getCmp('repListInfo').update(TYPO3.EM.Layouts.repositoryInfo().applyTemplate(record.data));
index 3771c58..4e5a660 100644 (file)
@@ -47,7 +47,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                        displayField: 'title',
                        valueField: 'uid',
                        store: this.repositoryStore,
-                       fieldLabel: TYPO3.lang.repository_select,
+                       fieldLabel: TYPO3.l10n.localize('repository_select'),
                        listeners: {
                                scope: this,
                                select: function(comboBox, newValue, oldValue) {
@@ -102,7 +102,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                        mirrorSm,
                        {
                                id: 'mirror-title',
-                               header: TYPO3.lang.mirror,
+                               header: TYPO3.l10n.localize('mirror'),
                                width: 200,
                                sortable: false,
                                menuDisabled: true,
@@ -111,7 +111,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                hidable: false
                        },{
                                id: 'mirror-country',
-                               header: TYPO3.lang.mirror_country,
+                               header: TYPO3.l10n.localize('mirror_country'),
                                width: 80,
                                sortable: false,
                                menuDisabled: true,
@@ -120,7 +120,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                hidable: false
                        },{
                                id: 'mirror-host',
-                               header: TYPO3.lang.mirror_url,
+                               header: TYPO3.l10n.localize('mirror_url'),
                                width: 180,
                                sortable: false,
                                menuDisabled: true,
@@ -129,7 +129,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                hidable: false
                        },{
                                id: 'mirror-sponsor',
-                               header: TYPO3.lang.mirror_sponsored_by,
+                               header: TYPO3.l10n.localize('mirror_sponsored_by'),
                                width: 180,
                                sortable: false,
                                menuDisabled: true,
@@ -139,7 +139,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
 
                        },{
                                id: 'mirror-logo',
-                               header: TYPO3.lang.mirror_logo_link,
+                               header: TYPO3.l10n.localize('mirror_logo_link'),
                                width: 180,
                                sortable: false,
                                menuDisabled: true,
@@ -170,14 +170,14 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                        labelWidth: 100,
                                        items: [{
                                                        xtype:'fieldset',
-                                                       title: TYPO3.lang.repositories,
+                                                       title: TYPO3.l10n.localize('repositories'),
                                                        collapsible: false,
                                                        defaultType: 'textfield',
                                                        height: 300,
                                                        items :[
                                                                this.repSettingsCombo,
                                                        {
-                                                               title: TYPO3.lang.repository_details,
+                                                               title: TYPO3.l10n.localize('repository_details'),
                                                                xtype: 'panel',
                                                                layout: 'fit',
                                                                id: 'repDescriptionDisplay',
@@ -188,24 +188,24 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                                                html: '',
                                                                bodyStyle: 'padding: 10px;',
                                                                buttons: [{
-                                                                       text: TYPO3.lang.cmd_create,
+                                                                       text: TYPO3.l10n.localize('cmd_create'),
                                                                        iconCls: 'x-btn-new',
                                                                        ref: '../newRep',
                                                                        handler: function() {
                                                                                var win = new TYPO3.EM.EditRepository({
                                                                                        isCreate: true,
-                                                                                       title: TYPO3.lang.repository_create
+                                                                                       title: TYPO3.l10n.localize('repository_create')
                                                                                }).show();
                                                                        },
                                                                        scope: this
                                                                }, ' ', {
-                                                                       text: TYPO3.lang.cmd_edit,
+                                                                       text: TYPO3.l10n.localize('cmd_edit'),
                                                                        iconCls: 'x-btn-edit',
                                                                        ref: '../editRep',
                                                                        handler: function() {
                                                                                var record = this.repositoryStore.getById(this.repSettingsCombo.getValue());
                                                                                var win = new TYPO3.EM.EditRepository({
-                                                                                       title: String.format(TYPO3.lang.repository_edit, record.data.title)
+                                                                                       title: String.format(TYPO3.l10n.localize('repository_edit'), record.data.title)
                                                                                });
                                                                                win.getComponent('repForm').getForm().setValues({
                                                                                        'title': record.data.title,
@@ -218,17 +218,17 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                                                        },
                                                                        scope: this
                                                                }, ' ', {
-                                                                       text: TYPO3.lang.cmd_delete,
+                                                                       text: TYPO3.l10n.localize('cmd_delete'),
                                                                        iconCls: 'x-btn-delete',
                                                                        ref: '../deleteRep',
                                                                        handler: function() {
                                                                                var record = this.repositoryStore.getById(this.repSettingsCombo.getValue());
-                                                                               var wait = Ext.MessageBox.wait(TYPO3.lang.repository_deleting, record.data.title);
+                                                                               var wait = Ext.MessageBox.wait(TYPO3.l10n.localize('repository_deleting'), record.data.title);
                                                                                TYPO3.EM.ExtDirect.deleteRepository(record.data.uid, function(response) {
                                                                                        if (response.success !== true) {
                                                                                                TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Invalid', action.result.error, 5);
                                                                                        } else {
-                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.lang.repository_delete, String.format(TYPO3.lang.repository_deleted, record.data.title), 5);
+                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, TYPO3.l10n.localize('repository_delete'), String.format(TYPO3.l10n.localize('repository_deleted'), record.data.title), 5);
                                                                                                TYPO3.settings.EM.selectedRepository = 1;
                                                                                                this.repSettingsCombo.setValue(1);
                                                                                                this.repositoryStore.load({
@@ -248,28 +248,28 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                                },
                                                {
                                                        xtype:'fieldset',
-                                                       title: TYPO3.lang.user_settings,
+                                                       title: TYPO3.l10n.localize('user_settings'),
                                                        collapsible: false,
                                                        defaults: {},
                                                        defaultType: 'textfield',
                                                        items :[
                                                        {
-                                                               fieldLabel: TYPO3.lang.enter_repository_username,
+                                                               fieldLabel: TYPO3.l10n.localize('enter_repository_username'),
                                                                name: 'fe_u'
                                                        }, {
-                                                               fieldLabel: TYPO3.lang.enter_repository_password,
+                                                               fieldLabel: TYPO3.l10n.localize('enter_repository_password'),
                                                                inputType: 'password',
                                                                name: 'fe_p'
                                                        },
                                                                new Ext.Container({
-                                                                       html: '<b>' + TYPO3.lang.notice + '</b> ' + TYPO3.lang.repository_password_info,
+                                                                       html: '<b>' + TYPO3.l10n.localize('notice') + '</b> ' + TYPO3.l10n.localize('repository_password_info'),
                                                                        xtype: 'displayfield',
                                                                        labelWidth: 1
                                                                })
                                                        ],
                                                        buttons: [
                                                                {
-                                                                       text: TYPO3.lang.cmd_save,
+                                                                       text: TYPO3.l10n.localize('cmd_save'),
                                                                        iconCls: 'x-btn-save',
                                                                        handler: function() {
                                                                                this.saveFormHandler();
@@ -282,7 +282,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                                flex: 1,
                                                border: false,
                                                xtype:'fieldset',
-                                               title: TYPO3.lang.mirror_selection,
+                                               title: TYPO3.l10n.localize('mirror_selection'),
                                                collapsible: false,
                                                autoHeight:true,
                                                items :[{
@@ -310,9 +310,9 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
 
        saveFormHandler: function() {
                this.getForm().submit({
-                       waitMsg : TYPO3.lang.action_saving_settings,
+                       waitMsg : TYPO3.l10n.localize('action_saving_settings'),
                        success: function(form, action) {
-                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.menu_settings, TYPO3.lang.settingsSaved, 5);
+                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('menu_settings'), TYPO3.l10n.localize('settingsSaved'), 5);
                                TYPO3.settings.EM.hasCredentials = (action.result.data.fe_u !== '' && action.result.data.fe_p !== '');
                                        // enable/disable user extension tab
                                if (TYPO3.settings.EM.hasCredentials) {
@@ -341,8 +341,8 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                panel.update([
                        '<h1 class="h1Panel">', record.title, '</h1>',
                        '<p class="panelDescription">', record.description, '</p>',
-                       '<p><b>', TYPO3.lang.mirror_url_long, ': ', '</b>', record.mirror_url, '<br />',
-                       '<b>', TYPO3.lang.wsdlUrl, ': ', '</b>', record.wsdl_url, '</p>'
+                       '<p><b>', TYPO3.l10n.localize('mirror_url_long'), ': ', '</b>', record.mirror_url, '<br />',
+                       '<b>', TYPO3.l10n.localize('wsdlUrl'), ': ', '</b>', record.wsdl_url, '</p>'
                ].join(''));
                if (record.uid == 1) {
                        panel.editRep.disable();
@@ -436,22 +436,22 @@ TYPO3.EM.EditRepository = Ext.extend(Ext.Window, {
                        paramsAsHash: false,
                        items: [{
                                itemId: 'title',
-                               fieldLabel: TYPO3.lang.extInfoArray_title,
+                               fieldLabel: TYPO3.l10n.localize('extInfoArray_title'),
                                name: 'title',
                                allowBlank: false
                        }, {
                                itemId: 'description',
-                               fieldLabel: TYPO3.lang.extInfoArray_description,
+                               fieldLabel: TYPO3.l10n.localize('extInfoArray_description'),
                                xtype: 'textarea',
                                name: 'description',
                                height: 100
                        }, {
                                itemId: 'mirror_url',
-                               fieldLabel: TYPO3.lang.mirror_url_long,
+                               fieldLabel: TYPO3.l10n.localize('mirror_url_long'),
                                name: 'mirror_url'
                        }, {
                                itemId: 'wsdl_url',
-                               fieldLabel: TYPO3.lang.wsdlUrl,
+                               fieldLabel: TYPO3.l10n.localize('wsdlUrl'),
                                name: 'wsdl_url',
                                allowBlank: false
                        }, {
@@ -468,7 +468,7 @@ TYPO3.EM.EditRepository = Ext.extend(Ext.Window, {
                Ext.apply(this, {
                        items: form,
                        buttons : [{
-                               text: TYPO3.lang.cmd_create,
+                               text: TYPO3.l10n.localize('cmd_create'),
                                iconCls: 'x-btn-save',
                                handler: function() {
                                        this.repositoryUpdate(form, 1);
@@ -476,7 +476,7 @@ TYPO3.EM.EditRepository = Ext.extend(Ext.Window, {
                                hidden: !this.isCreate,
                                scope: this
                        }, {
-                               text: TYPO3.lang.cmd_update,
+                               text: TYPO3.l10n.localize('cmd_update'),
                                iconCls: 'x-btn-save',
                                handler: function() {
                                  this.repositoryUpdate(form, 0);
@@ -484,7 +484,7 @@ TYPO3.EM.EditRepository = Ext.extend(Ext.Window, {
                                hidden: this.isCreate,
                                scope: this
                        }, {
-                               text: TYPO3.lang.cmd_cancel,
+                               text: TYPO3.l10n.localize('cmd_cancel'),
                                iconCls: 'x-btn-cancel',
                                handler: function() {
                                        this.close();
@@ -497,24 +497,24 @@ TYPO3.EM.EditRepository = Ext.extend(Ext.Window, {
 
        repositoryUpdate: function(form, type) {
                form.getForm().submit({
-                       waitMsg : type === 0 ? TYPO3.lang.repository_saving : TYPO3.lang.repository_creating,
+                       waitMsg : type === 0 ? TYPO3.l10n.localize('repository_saving') : TYPO3.l10n.localize('repository_creating'),
                        success: function(form, action) {
-                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.repository, type == 0
-                                               ? String.format(TYPO3.lang.repository_saved, action.result.params.title)
-                                               : String.format(TYPO3.lang.repository_saved, action.result.params.title)
+                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('repository'), type == 0
+                                               ? String.format(TYPO3.l10n.localize('repository_saved'), action.result.params.title)
+                                               : String.format(TYPO3.l10n.localize('repository_saved'), action.result.params.title)
                                                , 5);
                                Ext.StoreMgr.get('repositoriessettings').load();
                                this.close();
                        },
                        failure: function(form, action) {
                                if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                       TYPO3.lang.msg_status + ':' + action.response.status + ': ' +
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                       TYPO3.l10n.localize('msg_status') + ':' + action.response.status + ': ' +
                                                        action.response.statusText, 5);
                                }
                                if (action.failureType === Ext.form.Action.SERVER_INVALID){
                                        // server responded with success = false
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.errormsg, 15);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_invalid'), action.result.errormsg, 15);
                                }
                        },
                        scope: this
index 1bee523..ea14e95 100644 (file)
@@ -50,62 +50,62 @@ TYPO3.EM.TerUpload = Ext.extend(Ext.form.FormPanel, {
                                name: 'extKey',
                                value: this.recordData.extkey
                        }, {
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_username,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_username'),
                                name: 'fe_u'
                        }, {
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_password,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_password'),
                                inputType: 'password',
                                name: 'fe_p'
                        }, {
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_changelog,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_changelog'),
                                xtype: 'textarea',
                                height: 150,
                                name: 'uploadcomment'
                        }, {
                                xtype: 'radiogroup',
-                               fieldLabel: TYPO3.lang.repositoryUploadForm_new_version,
+                               fieldLabel: TYPO3.l10n.localize('repositoryUploadForm_new_version'),
                                itemCls: 'x-check-group-alt',
                                columns: 1,
                                items: [
                                        {
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_bugfix.replace('%s', 'x.x.<strong><span class="typo3-red">x+1</span></strong>'),
+                                               boxLabel: TYPO3.l10n.localize('repositoryUploadForm_new_bugfix').replace('%s', 'x.x.<strong><span class="typo3-red">x+1</span></strong>'),
                                                name: 'newversion',
                                                inputValue: 'new_dev',
                                                checked: true
                                        },
                                        {
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_sub_version.replace('%s', 'x.<strong><span class="typo3-red">x+1</span></strong>.0'),
+                                               boxLabel: TYPO3.l10n.localize('repositoryUploadForm_new_sub_version').replace('%s', 'x.<strong><span class="typo3-red">x+1</span></strong>.0'),
                                                name: 'newversion',
                                                inputValue: 'new_sub'
                                        },
                                        {
-                                               boxLabel: TYPO3.lang.repositoryUploadForm_new_main_version.replace('%s', '<strong><span class="typo3-red">x+1</span></strong>.0.0'),
+                                               boxLabel: TYPO3.l10n.localize('repositoryUploadForm_new_main_version').replace('%s', '<strong><span class="typo3-red">x+1</span></strong>.0.0'),
                                                name: 'newversion',
                                                inputValue: 'new_main'
                                        }
                                ]
                        }, {
                                xtype: 'button',
-                               text: TYPO3.lang.repositoryUploadForm_upload,
+                               text: TYPO3.l10n.localize('repositoryUploadForm_upload'),
                                scope: this,
                                handler: function() {
                                        this.form.submit({
-                                               waitMsg : TYPO3.lang.action_sending_data,
+                                               waitMsg : TYPO3.l10n.localize('action_sending_data'),
                                                success: function(form, action) {
                                                        var msg = action.result.response.resultMessages.join('<br /><br />');
-                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.cmd_terupload,
-                                                                       String.format(TYPO3.lang.msg_terupload, action.result.params.extKey) + '<br /><br />' + msg, 15);
+                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('cmd_terupload'),
+                                                                       String.format(TYPO3.l10n.localize('msg_terupload'), action.result.params.extKey) + '<br /><br />' + msg, 15);
                                                        Ext.StoreMgr.get('localstore').reload();
                                                },
                                                failure: function(form, action) {
                                                        if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                                               TYPO3.lang.msg_status + ': ' + action.result.response.status + ': '+
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                                               TYPO3.l10n.localize('msg_status') + ': ' + action.result.response.status + ': '+
                                                                                action.result.response.statusText, 5);
                                                        }
                                                        if (action.failureType === Ext.form.Action.SERVER_INVALID){
                                                                // server responded with success = false
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.errormsg, 5);
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_invalid'), action.result.errormsg, 5);
                                                        }
                                                }
                                        });
index 06e7300..835c97a 100644 (file)
@@ -62,7 +62,7 @@ TYPO3.EM.Tools = function() {
                                value = '[no title]';
                        }
                        if (record.data.reviewstate < 0) {
-                               description += '<br><br><strong>' + TYPO3.lang.insecureExtension + '</strong>';
+                               description += '<br><br><strong>' + TYPO3.l10n.localize('insecureExtension') + '</strong>';
                        }
                        return record.data.icon + ' ' + value + ' (v' + record.data.version + ')';
                },
index 1bfbcd0..18d2680 100644 (file)
@@ -64,7 +64,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                        extkeysSm,
                        {
                                id: 'extensionkey',
-                               header: TYPO3.lang.tab_mod_key,
+                               header: TYPO3.l10n.localize('tab_mod_key'),
                                width: .2,
                                sortable: true,
                                menuDisabled: true,
@@ -73,7 +73,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                        },
                        {
                                id: 'extensiontitle',
-                               header: TYPO3.lang.extInfoArray_title,
+                               header: TYPO3.l10n.localize('extInfoArray_title'),
                                width: .2,
                                sortable: true,
                                menuDisabled: true,
@@ -82,7 +82,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                        },
                        {
                                id: 'extensiondescription',
-                               header: TYPO3.lang.extInfoArray_description,
+                               header: TYPO3.l10n.localize('extInfoArray_description'),
                                width: .5,
                                sortable: true,
                                menuDisabled: true,
@@ -91,7 +91,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                        },
                        {
                                id: 'extensionuploads',
-                               header: TYPO3.lang.extInfoArray_uploads,
+                               header: TYPO3.l10n.localize('extInfoArray_uploads'),
                                width: .1,
                                sortable: true,
                                menuDisabled: true,
@@ -143,11 +143,11 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                        var error;
 
                                        if (!ExtDirectParams.result.raw) {
-                                               error = TYPO3.lang.soap_error;
+                                               error = TYPO3.l10n.localize('soap_error');
                                        } else {
                                                error = ExtDirectParams.result.raw.error;
                                        }
-                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, error, 15);
+                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_invalid'), error, 15);
                                        Ext.getCmp('extvalidformbutton').disable();
                                },
                                scope: this
@@ -185,12 +185,12 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                        items: [
                                                                {
                                                                        xtype:'fieldset',
-                                                                       title: TYPO3.lang.registerkeys_check_validity_extkey,
+                                                                       title: TYPO3.l10n.localize('registerkeys_check_validity_extkey'),
                                                                        defaults: {},
                                                                        defaultType: 'textfield',
                                                                        items :[
                                                                                {
-                                                                                       fieldLabel: TYPO3.lang.tab_mod_key,
+                                                                                       fieldLabel: TYPO3.l10n.localize('tab_mod_key'),
                                                                                        name: 'extkey',
                                                                                        width: 170,
                                                                                        allowBlank: false,
@@ -210,12 +210,12 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                                        buttons: [
                                                                                {
                                                                                        id: 'extvalidformbutton',
-                                                                                       text: TYPO3.lang.registerkeys_check_validity,
+                                                                                       text: TYPO3.l10n.localize('registerkeys_check_validity'),
                                                                                        handler: function() {
                                                                                                this.validityCheckForm.getForm().submit({
-                                                                                                       waitMsg : TYPO3.lang.registerkeys_check_validity,
+                                                                                                       waitMsg : TYPO3.l10n.localize('registerkeys_check_validity'),
                                                                                                        success: function(form, action) {
-                                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.registerkeys_check_validity_extkey_isvalid, '', 5);
+                                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('registerkeys_check_validity_extkey_isvalid'), '', 5);
 
                                                                                                                this.registerForm.getForm().setValues({
                                                                                                                        extkey: form.getValues().extkey,
@@ -228,13 +228,13 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
 
                                                                                                        failure: function(form, action) {
                                                                                                                if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                                                                                                       TYPO3.lang.msg_status + ': ' + action.response.status + ': ' +
+                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                                                                                                       TYPO3.l10n.localize('msg_status') + ': ' + action.response.status + ': ' +
                                                                                                                                                        action.response.statusText, 15);
                                                                                                                }
                                                                                                                if (action.failureType === Ext.form.Action.SERVER_INVALID) {
                                                                                                                        // server responded with success = false
-                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.message, 5);
+                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_invalid'), action.result.message, 5);
                                                                                                                }
                                                                                                        },
                                                                                                        scope: this
@@ -255,7 +255,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                        items: [
                                                                {
                                                                        xtype:'fieldset',
-                                                                       title: TYPO3.lang.registerkeys_registerkey,
+                                                                       title: TYPO3.l10n.localize('registerkeys_registerkey'),
                                                                        defaults: {},
                                                                        defaultType: 'textfield',
                                                                        items :[
@@ -268,16 +268,16 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                                                        html: '',
                                                                                        xtype: 'displayfield',
                                                                                        name: 'extkeydisplay',
-                                                                                       fieldLabel: TYPO3.lang.tab_mod_key
+                                                                                       fieldLabel: TYPO3.l10n.localize('tab_mod_key')
                                                                                },
                                                                                {
-                                                                                       fieldLabel: TYPO3.lang.extInfoArray_title,
+                                                                                       fieldLabel: TYPO3.l10n.localize('extInfoArray_title'),
                                                                                        name: 'title',
                                                                                        width: 170,
                                                                                        allowBlank: false
                                                                                },
                                                                                {
-                                                                                       fieldLabel: TYPO3.lang.extInfoArray_description,
+                                                                                       fieldLabel: TYPO3.l10n.localize('extInfoArray_description'),
                                                                                        xtype: 'textarea',
                                                                                        name: 'description',
                                                                                        width: 170,
@@ -287,12 +287,12 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                                        buttons: [
                                                                                {
                                                                                        id: 'extregisterformbutton',
-                                                                                       text: TYPO3.lang.cmd_register,
+                                                                                       text: TYPO3.l10n.localize('cmd_register'),
                                                                                        handler: function() {
                                                                                                this.registerForm.getForm().submit({
-                                                                                                       waitMsg : TYPO3.lang.registerkeys_register_extkey,
+                                                                                                       waitMsg : TYPO3.l10n.localize('registerkeys_register_extkey'),
                                                                                                        success: function(form, action) {
-                                                                                                               var msg = String.format(TYPO3.lang.registerkeys_register_extkey_success, this.registerForm.getForm().getValues().extkey);
+                                                                                                               var msg = String.format(TYPO3.l10n.localize('registerkeys_register_extkey_success'), this.registerForm.getForm().getValues().extkey);
                                                                                                                TYPO3.Flashmessage.display(TYPO3.Severity.information, msg, '', 5);
                                                                                                                form.reset();
                                                                                                                this.registerForm.hide();
@@ -301,13 +301,13 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                                                                        },
                                                                                                        failure: function(form, action) {
                                                                                                                if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
-                                                                                                                               TYPO3.lang.list_order_state + ':' + action.response.status + ': ' +
+                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_error'),
+                                                                                                                               TYPO3.l10n.localize('list_order_state') + ':' + action.response.status + ': ' +
                                                                                                                                action.response.statusText, 15);
                                                                                                                }
                                                                                                                if (action.failureType === Ext.form.Action.SERVER_INVALID) {
                                                                                                                        // server responded with success = false
-                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.message, 5);
+                                                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.l10n.localize('msg_invalid'), action.result.message, 5);
                                                                                                                }
                                                                                                        },
                                                                                                        scope: this
@@ -317,7 +317,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
 
                                                                                },
                                                                                {
-                                                                                       text: TYPO3.lang.registerkeys_cancel_register,
+                                                                                       text: TYPO3.l10n.localize('registerkeys_cancel_register'),
                                                                                        handler: function() {
                                                                                                this.registerForm.hide();
                                                                                                this.validityCheckForm.show()
@@ -337,14 +337,14 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                        items: [
                                                {
                                                        xtype: 'fieldset',
-                                                       title: TYPO3.lang.myExtensions,
+                                                       title: TYPO3.l10n.localize('myExtensions'),
                                                        items : [
                                                                {
                                                                        xtype: 'grid',
                                                                        id: 'em-userextgrid',
                                                                        stripeRows: true,
                                                                        store: userExtStore,
-                                                                       loadMask: {msg: TYPO3.lang.action_loading_extlist},
+                                                                       loadMask: {msg: TYPO3.l10n.localize('action_loading_extlist')},
                                                                        cm: extkeysCm,
                                                                        sm: extkeysSm,
                                                                        viewConfig: {
@@ -359,20 +359,20 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                                        tbar: [
                                                                                {
                                                                                        xtype: 'tbtext',
-                                                                                       text: TYPO3.lang.cmd_filter + ':'
+                                                                                       text: TYPO3.l10n.localize('cmd_filter') + ':'
                                                                                },
                                                                                searchField,
                                                                                '->',
                                                                                {
                                                                                        xtype: 'tbtext',
-                                                                                       text: TYPO3.lang.cmd_action + ':'
+                                                                                       text: TYPO3.l10n.localize('cmd_action') + ':'
                                                                                },
                                                                                ' ',
                                                                                {
                                                                                        xtype: 'tbbutton',
                                                                                        disabled: true,
                                                                                        id: 'transferkeybutton',
-                                                                                       text: TYPO3.lang.cmd_transferkey,
+                                                                                       text: TYPO3.l10n.localize('cmd_transferkey'),
                                                                                        handler: this.transferkey,
                                                                                        scope: this
                                                                                },
@@ -381,7 +381,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                                                                        xtype: 'tbbutton',
                                                                                        disabled: true,
                                                                                        id: 'deletekeybutton',
-                                                                                       text: TYPO3.lang.cmd_deletekey,
+                                                                                       text: TYPO3.l10n.localize('cmd_deletekey'),
                                                                                        handler: this.deletekey,
                                                                                        scope: this
                                                                                }
@@ -425,7 +425,7 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                        width: 300,
                        height: 170,
                        modal: true,
-                       title: TYPO3.lang.cmd_transferkey + ' "' + extkey + '"',
+                       title: TYPO3.l10n.localize('cmd_transferkey') + ' "' + extkey + '"',
                        layout: 'form',
                        items: [
                                {
@@ -434,13 +434,13 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                        items: [
                                                new Ext.Container({
                                                        xtype: 'displayfield',
-                                                       html: TYPO3.lang.transferkeys_info,
+                                                       html: TYPO3.l10n.localize('transferkeys_info'),
                                                        labelWidth: 1,
                                                        style: 'margin: 10px 5px;'
                                                }),
                                                {
                                                        xtype: 'textfield',
-                                                       fieldLabel: TYPO3.lang.cmd_transferkey_to_user,
+                                                       fieldLabel: TYPO3.l10n.localize('cmd_transferkey_to_user'),
                                                        ref: '../transfertouser',
                                                        allowBlank: false
                                                }
@@ -449,17 +449,17 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                        ],
                        buttons: [
                                {
-                                       text: TYPO3.lang.cmd_transferkey_do,
+                                       text: TYPO3.l10n.localize('cmd_transferkey_do'),
                                        handler: function(button) {
                                                var toUser = this.transferWindow.transfertouser.getRawValue();
                                                button.disable();
-                                               this.transferWindow.body.mask(TYPO3.lang.cmd_transferkey);
+                                               this.transferWindow.body.mask(TYPO3.l10n.localize('cmd_transferkey'));
                                                TYPO3.EMSOAP.ExtDirect.transferExtensionKey(extkey, toUser, function(response) {
                                                        if (response.success) {
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, String.format(TYPO3.lang.transferkeys_success, response.key, response.user), '', 5);
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, String.format(TYPO3.l10n.localize('transferkeys_success'), response.key, response.user), '', 5);
                                                                Ext.getCmp('em-userextgrid').store.load();
                                                        } else {
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, String.format(TYPO3.lang.transferkeys_fail, response.key, response.user),response.message, 15);
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, String.format(TYPO3.l10n.localize('transferkeys_fail'), response.key, response.user),response.message, 15);
                                                        }
                                                        this.transferWindow.close();
                                                }, this)
@@ -478,13 +478,13 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                        width: 300,
                        height: 130,
                        modal: true,
-                       title: TYPO3.lang.cmd_deletekey + ' "' + extkey + '"',
+                       title: TYPO3.l10n.localize('cmd_deletekey') + ' "' + extkey + '"',
                        items: [
                                {
                                        items: [
                                                new Ext.Container({
                                                        xtype: 'displayfield',
-                                                       html: TYPO3.lang.deletekey_info,
+                                                       html: TYPO3.l10n.localize('deletekey_info'),
                                                        labelWidth: 1,
                                                        style: 'margin: 10px 5px;'
                                                })
@@ -496,13 +496,13 @@ TYPO3.EM.UserTools = Ext.extend(Ext.Panel, {
                                        text: 'delete',
                                        handler: function(button) {
                                                button.disable();
-                                               this.deleteWindow.body.mask(TYPO3.lang.cmd_deletekey);
+                                               this.deleteWindow.body.mask(TYPO3.l10n.localize('cmd_deletekey'));
                                                TYPO3.EMSOAP.ExtDirect.deleteExtensionKey(extkey, function(response) {
                                                        if (response.success) {
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, String.format(TYPO3.lang.deletekey_success, response.key), '', 5);
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.ok, String.format(TYPO3.l10n.localize('deletekey_success'), response.key), '', 5);
                                                                Ext.getCmp('em-userextgrid').store.load();
                                                        } else {
-                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, String.format(TYPO3.lang.deletekey_fail, response.key), response.message, 15);
+                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, String.format(TYPO3.l10n.localize('deletekey_fail'), response.key), response.message, 15);
                                                        }
                                                        this.deleteWindow.close();
                                                }, this)
index 063884c..959b9d8 100644 (file)
@@ -64,9 +64,18 @@ class tx_indexedsearch_modfunc2 extends t3lib_extobjbase {
                $theOutput = $this->pObj->doc->spacer(5);
                $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('title'), $this->showStats(), 0, 1);
 
-               $menu=array();
-               $menu[]=t3lib_BEfunc::getFuncCheck($this->pObj->id,'SET[tx_indexedsearch_modfunc2_check]',$this->pObj->MOD_SETTINGS['tx_indexedsearch_modfunc2_check'],'','','id="checkTx_indexedsearch_modfunc2_check"').'<label for="checkTx_indexedsearch_modfunc2_check"'.$LANG->getLL('checklabel').'</label>';
-               $theOutput.=$this->pObj->doc->spacer(5);
+               $menu = array();
+               $functionMenu = t3lib_BEfunc::getFuncCheck(
+                       $this->pObj->id,
+                       'SET[tx_indexedsearch_modfunc2_check]',
+                       $this->pObj->MOD_SETTINGS['tx_indexedsearch_modfunc2_check'],
+                       '',
+                       '',
+                       'id="checkTx_indexedsearch_modfunc2_check"'
+               );
+               $menu[] = $functionMenu . '<label for="checkTx_indexedsearch_modfunc2_check"' .
+                       $GLOBALS['LANG']->getLL('checklabel') . '</label>';
+               $theOutput .= $this->pObj->doc->spacer(5);
 
                return $theOutput;
        }
diff --git a/typo3/sysext/lang/classes/cache/class.tx_lang_cache_abstract.php b/typo3/sysext/lang/classes/cache/class.tx_lang_cache_abstract.php
new file mode 100644 (file)
index 0000000..a0f0677
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Provides the abstract class for the caching subsystem.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+abstract class tx_lang_cache_Abstract implements t3lib_Singleton {
+
+       /**
+        * Local serialize function
+        *
+        * @var string
+        */
+       protected $serialize;
+
+       /**
+        * Local unserialize function
+        *
+        * @var string
+        */
+       protected $unserialize;
+
+       /**
+        * Cache constructor.
+        *
+        * Detects is the current setup supports igbinary.
+        */
+       public function __construct() {
+               if (extension_loaded('igbinary')) {
+                       $this->serialize = 'igbinary_serialize';
+                       $this->unserialize = 'igbinary_unserialize';
+               } else {
+                       $this->serialize = 'serialize';
+                       $this->unserialize = 'unserialize';
+               }
+       }
+
+       /**
+        * Gets the local serializer function.
+        *
+        * @return string
+        */
+       protected function getSerialize() {
+               return $this->serialize;
+       }
+
+       /**
+        * Gets the local unserializer function.
+        *
+        * @return string
+        */
+       protected function getUnserialize() {
+               return $this->unserialize;
+       }
+
+       /**
+        * Gets a cached value.
+        *
+        * @param string $hash Cache hash
+        * @return bool|mixed
+        */
+       abstract public function get($hash);
+
+       /**
+        * Adds a value to the cache.
+        *
+        * @throws RuntimeException
+        * @param string $hash Cache hash
+        * @param mixed $data
+        * @return tx_lang_CacheAbstract This class to allow method chaining
+        */
+       abstract public function set($hash, $data);
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/cache/class.tx_lang_cache_cachingframework.php b/typo3/sysext/lang/classes/cache/class.tx_lang_cache_cachingframework.php
new file mode 100644 (file)
index 0000000..56a6d9b
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Provides a cache based on the caching framework.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_cache_CachingFramework extends tx_lang_cache_Abstract {
+
+       /**
+        * Gets a cached value.
+        *
+        * @param  string $hash Cache hash
+        * @return bool|mixed
+        */
+       public function get($hash) {
+               $cacheIdentifier = 'language-' . $hash;
+               $cacheHash = md5($cacheIdentifier);
+               $cache = t3lib_pageSelect::getHash($cacheHash);
+               $unserialize = $this->getUnserialize();
+
+               if ($cache) {
+                       $data = $unserialize($cache);
+               } else {
+                       return FALSE;
+               }
+               return $data;
+       }
+
+       /**
+        * Adds a value to the cache.
+        *
+        * @throws RuntimeException
+        * @param string $hash Cache hash
+        * @param mixed $data
+        * @return tx_lang_cache_CachingFramework This instance to allow method chaining
+        */
+       public function set($hash, $data) {
+               $cacheIdentifier = 'language-' . $hash;
+               $cacheHash = md5($cacheIdentifier);
+               $serialize = $this->getSerialize();
+
+               t3lib_pageSelect::storeHash(
+                       $cacheHash,
+                       $serialize($data),
+                       'language'
+               );
+
+               return $this;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/cache/class.tx_lang_cache_file.php b/typo3/sysext/lang/classes/cache/class.tx_lang_cache_file.php
new file mode 100644 (file)
index 0000000..cc1c072
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Provides a simple cache based on the filesystem.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_cache_File extends tx_lang_cache_Abstract {
+
+       /**
+        * Get a cached value.
+        *
+        * @param  string $hash Cache hash
+        * @return bool|mixed
+        */
+       public function get($hash) {
+               $cacheFileName = $this->getCacheFilename($hash);
+               if (@is_file($cacheFileName)) {
+                       return unserialize(t3lib_div::getUrl($cacheFileName));
+               } else {
+                       return FALSE;
+               }
+       }
+
+       /**
+        * Adds a value to the cache.
+        *
+        * @throws RuntimeException
+        * @param string $hash Cache hash
+        * @param mixed $data
+        * @return tx_lang_cache_File This instance to allow method chaining
+        */
+       public function set($hash, $data) {
+               $cacheFileName = $this->getCacheFilename($hash);
+               $res = t3lib_div::writeFileToTypo3tempDir($cacheFileName, serialize($data));
+               if ($res !== NULL) {
+                       throw new RuntimeException(
+                               'TYPO3 Fatal Error: ' . $res,
+                               1270853903
+                       );
+               }
+
+               return $this;
+       }
+
+       /**
+        * Gets the cache absolute file path.
+        *
+        * @param string $hashSource Cache hash
+        * @return string
+        */
+       protected function getCacheFilename($hashSource) {
+               return PATH_site . 'typo3temp/llxml/' . $hashSource . '.cache';
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/class.tx_lang_factory.php b/typo3/sysext/lang/classes/class.tx_lang_factory.php
new file mode 100644 (file)
index 0000000..48564e1
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Provides a language parser factory.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_Factory implements t3lib_Singleton {
+
+       /**
+        * @var tx_lang_cache_Abstract
+        */
+       protected $cache;
+
+       /**
+        * @var integer
+        */
+       protected $errorMode;
+
+       /**
+        * @var tx_lang_Store
+        */
+       public $store;
+
+       /**
+        * Class constructor
+        */
+       public function __construct() {
+               $this->supportedExtension = array();
+               $this->ressourceConfiguration = array();
+               $this->store = t3lib_div::makeInstance('tx_lang_Store');
+
+               $this->initialize();
+       }
+
+       /**
+        * Sets factory configuration.
+        *
+        * @return void
+        */
+       public function initialize() {
+               $cacheClass = TYPO3_UseCachingFramework ? 'tx_lang_cache_CachingFramework' : 'tx_lang_cache_File';
+               $this->cache = t3lib_div::makeInstance($cacheClass);
+       }
+
+       /**
+        * Returns parsed data from a given file and language key.
+        *
+        * @param string $fileReference Input is a file-reference (see t3lib_div::getFileAbsFileName). That file is expected to be a supported locallang file format
+        * @param string $languageKey Language key
+        * @param string $charset Character set (option); if not set, determined by the language key
+        * @param int $errorMode Error mode (when file could not be found): 0 - syslog entry, 1 - do nothing, 2 - throw an exception
+        * @return array|bool
+        */
+       public function getParsedData($fileReference, $languageKey, $charset, $errorMode) {
+               $hash = md5($fileReference . $languageKey . $charset);
+               $this->errorMode = $errorMode;
+
+                       // English is the default language
+               $languageKey = ($languageKey === 'en') ? 'default' : $languageKey;
+
+                       // Check if the default language is processed before processing other language
+               if (!$this->store->hasData($fileReference, 'default') && $languageKey !== 'default') {
+                       $this->getParsedData($fileReference, 'default', $charset, $this->errorMode);
+               }
+
+                       // If the content is parsed (local cache), use it
+               if ($this->store->hasData($fileReference, $languageKey)) {
+                       return $this->store->getData($fileReference);
+               }
+
+                       // If the content is in cache (system cache), use it
+               if ($parsedData = $this->cache->get($hash)) {
+                       return $this->store->setData($fileReference, $languageKey, $parsedData)
+                                       ->getData($fileReference, $languageKey);
+               }
+
+               try {
+                       $this->store->setConfiguration($fileReference, $languageKey, $charset);
+
+                       /** @var $parser tx_lang_parser */
+                       $parser = $this->store->getParserInstance($fileReference);
+
+                       try {
+                               $LOCAL_LANG = $parser->getParsedData(
+                                       $this->store->getAbsoluteFileReference($fileReference),
+                                       $languageKey,
+                                       $charset
+                               );
+                               $this->store->setData(
+                                       $fileReference,
+                                       $languageKey,
+                                       $LOCAL_LANG[$languageKey]
+                               );
+
+                                       // Cache processed data
+                               $this->cache->set($hash, $this->store->getDataByLanguage($fileReference, $languageKey));
+                       } catch (tx_lang_exception_FileNotFound $exception) {
+                                       // Target localization file not found
+                               $this->store->setData($fileReference, $languageKey, array());
+                       }
+               } catch (tx_lang_exception_FileNotFound $exception) {
+                               // Source localization file not found
+                       $this->store->setData($fileReference, $languageKey, array());
+               }
+
+               return $this->store->getData($fileReference);
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/class.tx_lang_store.php b/typo3/sysext/lang/classes/class.tx_lang_store.php
new file mode 100644 (file)
index 0000000..a6401a2
--- /dev/null
@@ -0,0 +1,225 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Language store.
+ *
+ * @package    Core
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dominique.feyer@reelpeek.net>
+ */
+class tx_lang_Store implements t3lib_Singleton {
+
+       /**
+        * File extension supported by the localization parser
+        *
+        * @var array
+        */
+       protected $supportedExtensions;
+
+       /**
+        * Information about parsed file
+        *
+        * If data come from the cache, this array does not contain
+        * any information about this file
+        *
+        * @var array
+        */
+       protected $configuration;
+
+       /**
+        * Parsed localization file
+        *
+        * @var array
+        */
+       protected $data;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->initialize();
+       }
+
+       /**
+        * Initializes the current class.
+        *
+        * @return void
+        */
+       public function initialize() {
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['format']['priority']) && trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['format']['priority']) !== '') {
+                       $this->supportedExtensions = t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['format']['priority']);
+               } else {
+                       $this->supportedExtensions = array('xlf', 'xml', 'php');
+               }
+       }
+
+       /**
+        * Checks if the store contains parsed data.
+        *
+        * @param string $fileReference File reference
+        * @param string $languageKey Valid language key
+        * @return bool
+        */
+       public function hasData($fileReference, $languageKey) {
+               if (isset($this->data[$fileReference][$languageKey]) && is_array($this->data[$fileReference][$languageKey])) {
+                       return TRUE;
+               }
+               return FALSE;
+       }
+
+       /**
+        * Retrieves data from the store.
+        *
+        * This method returns all parsed languages for the current file reference.
+        *
+        * @param string $fileReference File reference
+        * @return array
+        */
+       public function getData($fileReference) {
+               return $this->data[$fileReference];
+       }
+
+       /**
+        * Retrieves data from the store for a language.
+        *
+        * @param string $fileReference File reference
+        * @param string $languageKey Valid language key
+        * @return array
+        * @see self::getData()
+        */
+       public function getDataByLanguage($fileReference, $languageKey) {
+               return $this->data[$fileReference][$languageKey];
+       }
+
+       /**
+        * Sets data for a specific file reference and a language.
+        *
+        * @param string $fileReference File reference
+        * @param string $languageKey Valid language key
+        * @param $data
+        * @return tx_lang_Store This instance to allow method chaining
+        */
+       public function setData($fileReference, $languageKey, $data) {
+               $this->data[$fileReference][$languageKey] = $data;
+               return $this;
+       }
+
+       /**
+        * Checks file reference configuration (charset, extension, ...).
+        *
+        * @throws tx_lang_exception_InvalidParser|tx_lang_exception_FileNotFound
+        * @param string $fileReference File reference
+        * @param string $languageKey Valid language key
+        * @param string $charset Rendering charset
+        * @return tx_lang_Store This instance to allow method chaining
+        */
+       public function setConfiguration($fileReference, $languageKey, $charset) {
+               $this->configuration[$fileReference] = array(
+                       'fileReference' => $fileReference,
+                       'fileExtension' => FALSE,
+                       'parserClass' => NULL,
+                       'languageKey' => $languageKey,
+                       'charset' => $charset
+               );
+
+               $fileWithoutExtension = t3lib_div::getFileAbsFileName(preg_replace('/\.[a-z0-9]+$/i' , '' , $fileReference));
+
+               foreach ($this->supportedExtensions as $extension) {
+                       if (@is_file($fileWithoutExtension . '.' . $extension)) {
+                               $this->configuration[$fileReference]['fileReference'] = $fileWithoutExtension . '.' . $extension;
+                               $this->configuration[$fileReference]['fileExtension'] = $extension;
+                               break;
+                       }
+               }
+
+               if ($this->configuration[$fileReference]['fileExtension'] === FALSE) {
+                       throw new tx_lang_exception_FileNotFound(
+                               sprintf('Source localization file (%s) not found', $fileReference),
+                               1306410755
+                       );
+               }
+
+               $extension = $this->configuration[$fileReference]['fileExtension'];
+
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['parser'][$extension]) && trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['parser'][$extension]) !== '') {
+                       $this->configuration[$fileReference]['parserClass'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['parser'][$extension];
+               } else {
+                       throw new tx_lang_exception_InvalidParser(
+                               'TYPO3 Fatal Error: l10n parser for file extension "' . $extension . '" is not configured! Please check you configuration.',
+                               1301579637
+                       );
+               }
+
+               if (!class_exists($this->configuration[$fileReference]['parserClass']) || trim($this->configuration[$fileReference]['parserClass']) === '') {
+                       throw new tx_lang_exception_InvalidParser(
+                               'TYPO3 Fatal Error: l10n parser "' . $this->configuration[$fileReference]['parserClass'] . '" cannot be found or is an empty parser!',
+                               1270853900
+                       );
+               }
+
+               return $this;
+       }
+
+       /**
+        * Returns the correct parser for a specific file reference.
+        *
+        * @throws tx_lang_exception_InvalidParser
+        * @param string $fileReference File reference
+        * @return tx_lang_ParserInterface
+        */
+       public function getParserInstance($fileReference) {
+               if (isset($this->configuration[$fileReference]['parserClass']) && trim($this->configuration[$fileReference]['parserClass']) !== '') {
+                       return t3lib_div::makeInstance((string) $this->configuration[$fileReference]['parserClass']);
+               } else {
+                       throw new tx_lang_exception_InvalidParser(
+                               sprintf('Invalid parser configuration for the current file (%s)', $fileReference),
+                               1307293692
+                       );
+               }
+       }
+
+       /**
+        * Gets the absolute file path.
+        *
+        * @throws InvalidArgumentException
+        * @param string $fileReference
+        * @return string
+        */
+       public function getAbsoluteFileReference($fileReference) {
+               if (isset($this->configuration[$fileReference]['fileReference']) && trim($this->configuration[$fileReference]['fileReference']) !== '') {
+                       return (string) $this->configuration[$fileReference]['fileReference'];
+               } else {
+                       throw new InvalidArgumentException(
+                               sprintf('Invalid file reference configuration for the current file (%s)', $fileReference),
+                               1307293692
+                       );
+               }
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/exception/class.tx_lang_exception_filenotfound.php b/typo3/sysext/lang/classes/exception/class.tx_lang_exception_filenotfound.php
new file mode 100644 (file)
index 0000000..72dc516
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * File not found exception
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_exception_FileNotFound extends RuntimeException {
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidparser.php b/typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidparser.php
new file mode 100644 (file)
index 0000000..3ea9436
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Invalid Parser exception
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_exception_InvalidParser extends RuntimeException {
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidxmlfile.php b/typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidxmlfile.php
new file mode 100644 (file)
index 0000000..a076b34
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Invalid XML file exception
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_exception_InvalidXmlFile extends RuntimeException {
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/interfaces/interface.tx_lang_parser.php b/typo3/sysext/lang/classes/interfaces/interface.tx_lang_parser.php
new file mode 100644 (file)
index 0000000..9afc3cc
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Parser interface.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+interface tx_lang_parser {
+
+       /**
+        * Returns parsed representation of XML file.
+        *
+        * @param string $sourcePath Source file path
+        * @param string $languageKey Language key
+        * @param string $charset Charset
+        * @return array
+        */
+       public function getParsedData($sourcePath, $languageKey, $charset);
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/parser/class.tx_lang_parser_abstractxml.php b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_abstractxml.php
new file mode 100644 (file)
index 0000000..1cb5625
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Abstract class for XML based parser.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+abstract class tx_lang_parser_AbstractXml implements tx_lang_parser {
+
+       /**
+        * @var string
+        */
+       protected $sourcePath;
+
+       /**
+        * @var string
+        */
+       protected $languageKey;
+
+       /**
+        * @var string
+        */
+       protected $charset;
+
+       /**
+        * Returns parsed representation of XML file.
+        *
+        * @throws tx_lang_exception_FileNotFound
+        * @param string $sourcePath Source file path
+        * @param string $languageKey Language key
+        * @param string $charset File charset
+        * @return array
+        */
+       public function getParsedData($sourcePath, $languageKey, $charset = '') {
+               $this->sourcePath = $sourcePath;
+               $this->languageKey = $languageKey;
+               $this->charset = $this->getCharset($languageKey, $charset);
+
+               if (($this->languageKey !== 'default' && $this->languageKey !== 'en')) {
+                       $this->sourcePath = t3lib_div::getFileAbsFileName(
+                               t3lib_div::llXmlAutoFileName($this->sourcePath, $this->languageKey)
+                       );
+
+                       if (!@is_file($this->sourcePath)) {
+                               throw new tx_lang_exception_FileNotFound(
+                                       'Localization file does not exist',
+                                       1306332397
+                               );
+                       }
+               }
+
+               $LOCAL_LANG = array();
+               $LOCAL_LANG[$languageKey] = $this->parseXmlFile();
+
+               return $LOCAL_LANG;
+       }
+
+       /**
+        * Gets the character set to use.
+        *
+        * @param string $languageKey
+        * @param string $charset
+        * @return string
+        */
+       protected function getCharset($languageKey, $charset = '') {
+               /** @var $csConvObj t3lib_cs */
+               if (is_object($GLOBALS['LANG'])) {
+                       $csConvObj = $GLOBALS['LANG']->csConvObj;
+               } elseif (is_object($GLOBALS['TSFE'])) {
+                       $csConvObj = $GLOBALS['TSFE']->csConvObj;
+               } else {
+                       $csConvObj = t3lib_div::makeInstance('t3lib_cs');
+               }
+
+               if ($charset !== '') {
+                       $targetCharset = $csConvObj->parse_charset($charset);
+               } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) {
+                               // When forceCharset is set, we store ALL labels in this charset!!!
+                       $targetCharset = $csConvObj->parse_charset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']);
+               } else {
+                       $targetCharset = $csConvObj->parse_charset($csConvObj->charSetArray[$languageKey] ? $csConvObj->charSetArray[$languageKey] : 'iso-8859-1');
+               }
+
+               return $targetCharset;
+       }
+
+       /**
+        * Loads the current XML file before processing.
+        *
+        * @throws tx_lang_exception_InvalidXmlFile
+        * @return array An array representing parsed XML file (structure depends on concrete parser)
+        */
+       protected function parseXmlFile() {
+               $rootXmlNode = simplexml_load_file($this->sourcePath, 'SimpleXmlElement', \LIBXML_NOWARNING);
+
+               if (!isset($rootXmlNode) || $rootXmlNode === FALSE) {
+                       throw new tx_lang_exception_InvalidXmlFile(
+                               'The path provided does not point to existing and accessible well-formed XML file.',
+                               1278155987
+                       );
+               }
+
+               return $this->doParsingFromRoot($rootXmlNode);
+       }
+
+       /**
+        * Returns array representation of XML data, starting from a root node.
+        *
+        * @abstract
+        * @param SimpleXMLElement $root A root node
+        * @return array An array representing the parsed XML file
+        */
+       abstract protected function doParsingFromRoot(SimpleXMLElement $root);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/parser/class.tx_lang_parser_llphp.php b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_llphp.php
new file mode 100644 (file)
index 0000000..5295899
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Parser for PHP locallang array.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_parser_Llphp implements tx_lang_parser {
+
+       /**
+        * Returns parsed representation of PHP locallang file.
+        *
+        * @throws RuntimeException
+        * @param string $sourcePath Source file path
+        * @param string $languageKey Language key
+        * @param string $charset Charset
+        * @return void
+        */
+       public function getParsedData($sourcePath, $languageKey, $charset = '') {
+               throw new RuntimeException(
+                       'Parser for plain old PHP array is not yet implemented.',
+                       1301654458
+               );
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/parser/class.tx_lang_parser_llxml.php b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_llxml.php
new file mode 100644 (file)
index 0000000..c003b13
--- /dev/null
@@ -0,0 +1,159 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Parser for XML locallang file.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_parser_Llxml extends tx_lang_parser_AbstractXml {
+
+       /**
+        * Associative array of "filename => parsed data" pairs.
+        *
+        * @var array
+        */
+       protected $parsedTargetFiles;
+
+       /**
+        * Returns parsed representation of XML file.
+        *
+        * @param string $sourcePath Source file path
+        * @param string $languageKey Language key
+        * @param string $charset Charset
+        * @return array
+        */
+       public function getParsedData($sourcePath, $languageKey, $charset = '') {
+               $this->sourcePath = $sourcePath;
+               $this->languageKey = $languageKey;
+               $this->charset = $this->getCharset($languageKey, $charset);
+
+                       // Parse source
+               $parsedSource = $this->parseXmlFile();
+
+                       // Parse target
+               $localizedTargetPath = t3lib_div::getFileAbsFileName(t3lib_div::llXmlAutoFileName($this->sourcePath, $this->languageKey));
+               $targetPath = ($this->languageKey !== 'default' && @is_file($localizedTargetPath)) ? $localizedTargetPath : $this->sourcePath;
+
+               try {
+                       $parsedTarget = $this->getParsedTargetData($targetPath);
+               } catch (tx_lang_exception_InvalidXmlFile $e) {
+                       $parsedTarget = $this->getParsedTargetData($this->sourcePath);
+               }
+
+               $LOCAL_LANG = array();
+               $LOCAL_LANG[$languageKey] = t3lib_div::array_merge_recursive_overrule($parsedSource, $parsedTarget);
+
+               return $LOCAL_LANG;
+       }
+
+       /**
+        * Returns array representation of XLIFF data, starting from a root node.
+        *
+        * @param SimpleXMLElement $root XML root element
+        * @param string $element Target or Source
+        * @return array
+        */
+       protected function _doParsingFromRoot(SimpleXMLElement $root, $element) {
+               $parsedData = array();
+               $bodyOfFileTag = $root->data->languageKey;
+
+               foreach ($bodyOfFileTag->children() as $translationElement) {
+                       if ($translationElement->getName() === 'label') {
+                                       // If restype would be set, it could be metadata from Gettext to XLIFF conversion (and we don't need this data)
+
+                               $parsedData[(string)$translationElement['index']][0] = array(
+                                       $element => (string)$translationElement,
+                               );
+                       }
+               }
+
+               return $parsedData;
+       }
+
+       /**
+        * Returns array representation of XLIFF data, starting from a root node.
+        *
+        * @param \SimpleXMLElement $root A root node
+        * @return array An array representing parsed XLIFF
+        * @todo Support "approved" attribute
+        */
+       protected function doParsingFromRoot(SimpleXMLElement $root) {
+               return $this->_doParsingFromRoot($root, 'source');
+       }
+
+       /**
+        * Returns array representation of XLIFF data, starting from a root node.
+        *
+        * @param \SimpleXMLElement $root A root node
+        * @return array An array representing parsed XLIFF
+        * @todo Support "approved" attribute
+        */
+       protected function doParsingTargetFromRoot(SimpleXMLElement $root) {
+               return $this->_doParsingFromRoot($root, 'target');
+       }
+
+       /**
+        * Returns parsed representation of XML file.
+        *
+        * Parses XML if it wasn't done before. Caches parsed data.
+        *
+        * @param string $path An absolute path to XML file
+        * @return array Parsed XML file
+        */
+       public function getParsedTargetData($path) {
+               if (!isset($this->parsedTargetFiles[$path])) {
+                       $this->parsedTargetFiles[$path] = $this->parseXmlTargetFile($path);
+               }
+               return $this->parsedTargetFiles[$path];
+       }
+
+       /**
+        * Reads and parses XML file and returns internal representation of data.
+        *
+        * @throws tx_lang_exception_InvalidXmlFile
+        * @param string $targetPath Path of the target file
+        * @return array
+        */
+       protected function parseXmlTargetFile($targetPath) {
+               $rootXmlNode = FALSE;
+
+               if (file_exists($targetPath)) {
+                       $rootXmlNode = simplexml_load_file($targetPath, 'SimpleXmlElement', \LIBXML_NOWARNING);
+               }
+
+               if (!isset($rootXmlNode) || $rootXmlNode === FALSE) {
+                       throw new tx_lang_exception_InvalidXmlFile('The path provided does not point to existing and accessible well-formed XML file (' . $targetPath . ').', 1278155987);
+               }
+
+               return $this->doParsingTargetFromRoot($rootXmlNode);
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/classes/parser/class.tx_lang_parser_xliff.php b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_xliff.php
new file mode 100644 (file)
index 0000000..14d6d85
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Dominique Feyer <dfeyer@reelpeek.net>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Parser for XLIFF file.
+ *
+ * @package    TYPO3
+ * @subpackage tx_lang
+ * @author     Dominique Feyer <dfeyer@reelpeek.net>
+ */
+class tx_lang_parser_Xliff extends tx_lang_parser_AbstractXml {
+
+       /**
+        * Returns array representation of XML data, starting from a root node.
+        *
+        * @param SimpleXMLElement $root A root node
+        * @return array An array representing the parsed XML file
+        */
+       protected function doParsingFromRoot(SimpleXMLElement $root) {
+               $parsedData = array();
+               $bodyOfFileTag = $root->file->body;
+
+               foreach ($bodyOfFileTag->children() as $translationElement) {
+                       if ($translationElement->getName() === 'trans-unit' && !isset($translationElement['restype'])) {
+                                       // If restype would be set, it could be metadata from Gettext to XLIFF conversion (and we don't need this data)
+
+                               $parsedData[(string)$translationElement['id']][0] = array(
+                                       'source' => (string)$translationElement->source,
+                                       'target' => (string)$translationElement->target,
+                               );
+                       } elseif ($translationElement->getName() === 'group' && isset($translationElement['restype']) && (string)$translationElement['restype'] === 'x-gettext-plurals') {
+                                       // This is a translation with plural forms
+                               $parsedTranslationElement = array();
+
+                               foreach ($translationElement->children() as $translationPluralForm) {
+                                       if ($translationPluralForm->getName() === 'trans-unit') {
+                                                       // When using plural forms, ID looks like this: 1[0], 1[1] etc
+                                               $formIndex = substr((string)$translationPluralForm['id'], strpos((string)$translationPluralForm['id'], '[') + 1, -1);
+
+                                               $parsedTranslationElement[(int)$formIndex] = array(
+                                                       'source' => (string)$translationPluralForm->source,
+                                                       'target' => (string)$translationPluralForm->target,
+                                               );
+                                       }
+                               }
+
+                               if (!empty($parsedTranslationElement)) {
+                                       if (isset($translationElement['id'])) {
+                                               $id = (string)$translationElement['id'];
+                                       } else {
+                                               $id = (string)($translationElement->{'trans-unit'}[0]['id']);
+                                               $id = substr($id, 0, strpos($id, '['));
+                                       }
+
+                                       $parsedData[$id] = $parsedTranslationElement;
+                               }
+                       }
+               }
+
+               return $parsedData;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/lang/ext_autoload.php b/typo3/sysext/lang/ext_autoload.php
new file mode 100644 (file)
index 0000000..57f4e1b
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+// DO NOT CHANGE THIS FILE! It is automatically generated by extdeveval::buildAutoloadRegistry.
+// This file was generated on 2011-06-14 11:34
+
+$extensionPath = t3lib_extMgm::extPath('lang');
+$extensionClassesPath = t3lib_extMgm::extPath('lang') . 'classes/';
+return array(
+       'tx_lang_factory' => $extensionClassesPath . 'class.tx_lang_factory.php',
+       'tx_lang_store' => $extensionClassesPath . 'class.tx_lang_store.php',
+       'tx_lang_cache_abstract' => $extensionClassesPath . 'cache/class.tx_lang_cache_abstract.php',
+       'tx_lang_cache_cachingframework' => $extensionClassesPath . 'cache/class.tx_lang_cache_cachingframework.php',
+       'tx_lang_cache_file' => $extensionClassesPath . 'cache/class.tx_lang_cache_file.php',
+       'tx_lang_exception_filenotfound' => $extensionClassesPath . 'exception/class.tx_lang_exception_filenotfound.php',
+       'tx_lang_exception_invalidparser' => $extensionClassesPath . 'exception/class.tx_lang_exception_invalidparser.php',
+       'tx_lang_exception_invalidxmlfile' => $extensionClassesPath . 'exception/class.tx_lang_exception_invalidxmlfile.php',
+       'tx_lang_parser' => $extensionClassesPath . 'interfaces/interface.tx_lang_parser.php',
+       'tx_lang_parser_abstractxml' => $extensionClassesPath . 'parser/class.tx_lang_parser_abstractxml.php',
+       'tx_lang_parser_llphp' => $extensionClassesPath . 'parser/class.tx_lang_parser_llphp.php',
+       'tx_lang_parser_llxml' => $extensionClassesPath . 'parser/class.tx_lang_parser_llxml.php',
+       'tx_lang_parser_xliff' => $extensionClassesPath . 'parser/class.tx_lang_parser_xliff.php',
+);
+?>
\ No newline at end of file