diff --git a/t3lib/class.t3lib_div.php b/t3lib/class.t3lib_div.php index 0f9c9603596e753e0b2c1a8ae47441dd21561868..dadaa2f80153e1322ce3914cac62868ad63f314c 100644 --- a/t3lib/class.t3lib_div.php +++ b/t3lib/class.t3lib_div.php @@ -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; } } diff --git a/t3lib/class.t3lib_pagerenderer.php b/t3lib/class.t3lib_pagerenderer.php index 7348a9c945d3eb19cb6f572715d37998b0cd1df3..fd93b9b0bce05c9e82154caf08c2968feeecb9dd 100644 --- a/t3lib/class.t3lib_pagerenderer.php +++ b/t3lib/class.t3lib_pagerenderer.php @@ -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) { diff --git a/t3lib/config_default.php b/t3lib/config_default.php index f937c49aa605352fb42d1c2dded3f86cbbc44547..dda34e33b2715c3ab75bf7747a4a2f1a6af02943 100644 --- a/t3lib/config_default.php +++ b/t3lib/config_default.php @@ -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) diff --git a/t3lib/core_autoload.php b/t3lib/core_autoload.php index f259df3446e2b50040ee4f30048445511737bc75..aefd876b5049621c77246d37e42dc00ca1a7a2cb 100644 --- a/t3lib/core_autoload.php +++ b/t3lib/core_autoload.php @@ -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 diff --git a/typo3/index.php b/typo3/index.php index 2b7fb7bea126f9581261215e539f1b4b5a3fd8ae..9281a7e35a84bc4c7560299cf62d7681f69312dd 100644 --- a/typo3/index.php +++ b/typo3/index.php @@ -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); } } } diff --git a/typo3/sysext/cms/tslib/class.tslib_fe.php b/typo3/sysext/cms/tslib/class.tslib_fe.php index 57dc4da507b7c5e32e55cb764d68066f7bae2576..5735554f5891c9f2caba1789b86843f1ee748158 100644 --- a/typo3/sysext/cms/tslib/class.tslib_fe.php +++ b/typo3/sysext/cms/tslib/class.tslib_fe.php @@ -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; } /** diff --git a/typo3/sysext/cms/tslib/class.tslib_pibase.php b/typo3/sysext/cms/tslib/class.tslib_pibase.php index 82a67c4bdae82cc94267417d0e31c6f13c76a278..ba6fc4a9134667eb653854aaad09ba19f0572298 100644 --- a/typo3/sysext/cms/tslib/class.tslib_pibase.php +++ b/typo3/sysext/cms/tslib/class.tslib_pibase.php @@ -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]; + } } } } diff --git a/typo3/sysext/em/res/js/em_app.js b/typo3/sysext/em/res/js/em_app.js index 4c41be4cea6f3c1d7d05fcf137e6f5b612a21b56..c1c713c111b1f9f8124512a2b08f1d0cdbdee68c 100644 --- a/typo3/sysext/em/res/js/em_app.js +++ b/typo3/sysext/em/res/js/em_app.js @@ -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() { diff --git a/typo3/sysext/em/res/js/em_components.js b/typo3/sysext/em/res/js/em_components.js index 97bff971693e7fd8f0d5848ac9f9a4d508bc20c2..ad14372a96b6ecfc9254e8ce937594492fd94a1e 100644 --- a/typo3/sysext/em/res/js/em_components.js +++ b/typo3/sysext/em/res/js/em_components.js @@ -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); } } }); diff --git a/typo3/sysext/em/res/js/em_files.js b/typo3/sysext/em/res/js/em_files.js index f42ff67783075cfd359dac7c1684dea8d4f1654a..478dc678101480dca8d5cf953c0ba73cc14ca73a 100644 --- a/typo3/sysext/em/res/js/em_files.js +++ b/typo3/sysext/em/res/js/em_files.js @@ -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' } diff --git a/typo3/sysext/em/res/js/em_languages.js b/typo3/sysext/em/res/js/em_languages.js index 36de6e1a130159be0757df0a03b7f14a1abd8cab..e75030ba22084a64628019c4e9cafcfba918ead8 100644 --- a/typo3/sysext/em/res/js/em_languages.js +++ b/typo3/sysext/em/res/js/em_languages.js @@ -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"> </span>' + value; } return '<span class="x-mask-loading"> </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 + '"> </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); diff --git a/typo3/sysext/em/res/js/em_layouts.js b/typo3/sysext/em/res/js/em_layouts.js index 8a6297200df0283de0fc54b6f5f93238f6d08989..ab5cc0654b49ebe7a04273f6dbd97684baf84ad0 100644 --- a/typo3/sysext/em/res/js/em_layouts.js +++ b/typo3/sysext/em/res/js/em_layouts.js @@ -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} ', - 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(')', ''); } } ); diff --git a/typo3/sysext/em/res/js/em_locallist.js b/typo3/sysext/em/res/js/em_locallist.js index 668a5c0d7f3cd73544b7aab89ba062c925ed7265..019f6d13f8e776189d689f9fb20a83c3efe3dbfe 100644 --- a/typo3/sysext/em/res/js/em_locallist.js +++ b/typo3/sysext/em/res/js/em_locallist.js @@ -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'} }, diff --git a/typo3/sysext/em/res/js/em_repositorylist.js b/typo3/sysext/em/res/js/em_repositorylist.js index 85c964bcbabe02bad743eff928da8817b8dbef3d..6f35e4df21124b23c62438b5459c6c3519be0feb 100644 --- a/typo3/sysext/em/res/js/em_repositorylist.js +++ b/typo3/sysext/em/res/js/em_repositorylist.js @@ -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)); diff --git a/typo3/sysext/em/res/js/em_settings.js b/typo3/sysext/em/res/js/em_settings.js index 3771c58b39002de36b4fb0a6044b0ba493a99adf..4e5a660b686ba36533091d98e158d436213d2ecc 100644 --- a/typo3/sysext/em/res/js/em_settings.js +++ b/typo3/sysext/em/res/js/em_settings.js @@ -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 diff --git a/typo3/sysext/em/res/js/em_ter.js b/typo3/sysext/em/res/js/em_ter.js index 1bee523b0cafbd852d5ada5ef6074c9c4f48118d..ea14e95cc641133a15e42a29087062fbd6ef9d2a 100644 --- a/typo3/sysext/em/res/js/em_ter.js +++ b/typo3/sysext/em/res/js/em_ter.js @@ -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); } } }); diff --git a/typo3/sysext/em/res/js/em_tools.js b/typo3/sysext/em/res/js/em_tools.js index 06e7300a826bb3b62cd2dc540c0bc835b04abfd9..835c97afd26855dcef40e81f6fcbad1f9214ba0e 100644 --- a/typo3/sysext/em/res/js/em_tools.js +++ b/typo3/sysext/em/res/js/em_tools.js @@ -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 + ')'; }, diff --git a/typo3/sysext/em/res/js/em_usertools.js b/typo3/sysext/em/res/js/em_usertools.js index 1bfbcd0e6f5a2c71534c32d8869c8ed758d45189..18d2680ba75ea0c5bb74b3c34c42b246dfc09cf3 100644 --- a/typo3/sysext/em/res/js/em_usertools.js +++ b/typo3/sysext/em/res/js/em_usertools.js @@ -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) diff --git a/typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php b/typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php index 063884ceea7222fc1ff1dfa728122099774ef259..959b9d87cbc48efda887c38654ad1704f01ce47a 100644 --- a/typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php +++ b/typo3/sysext/indexed_search/modfunc2/class.tx_indexedsearch_modfunc2.php @@ -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 index 0000000000000000000000000000000000000000..a0f06779284cc8f6a645b6b2b856cba493341cf6 --- /dev/null +++ b/typo3/sysext/lang/classes/cache/class.tx_lang_cache_abstract.php @@ -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 index 0000000000000000000000000000000000000000..56a6d9bbead1842a0d269e764738a35842ad80f5 --- /dev/null +++ b/typo3/sysext/lang/classes/cache/class.tx_lang_cache_cachingframework.php @@ -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 index 0000000000000000000000000000000000000000..cc1c07274cf634d97fbca6345d2441e3d78ca5a7 --- /dev/null +++ b/typo3/sysext/lang/classes/cache/class.tx_lang_cache_file.php @@ -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 index 0000000000000000000000000000000000000000..48564e12e9d8fb7bec763f70a81677ba6db45088 --- /dev/null +++ b/typo3/sysext/lang/classes/class.tx_lang_factory.php @@ -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 index 0000000000000000000000000000000000000000..a6401a2738da3152a2273f94643b178c61299c78 --- /dev/null +++ b/typo3/sysext/lang/classes/class.tx_lang_store.php @@ -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 index 0000000000000000000000000000000000000000..72dc516906285b481e3d5ac2c3068145ac4ff40a --- /dev/null +++ b/typo3/sysext/lang/classes/exception/class.tx_lang_exception_filenotfound.php @@ -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 index 0000000000000000000000000000000000000000..3ea9436d04c02989a470a2f4e4807ceaa310f93c --- /dev/null +++ b/typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidparser.php @@ -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 index 0000000000000000000000000000000000000000..a076b3474be4da3e66ae2c46dc09b03f28319d72 --- /dev/null +++ b/typo3/sysext/lang/classes/exception/class.tx_lang_exception_invalidxmlfile.php @@ -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 index 0000000000000000000000000000000000000000..9afc3cc0cdb411a70338d00fc4ed2ee071ae33c0 --- /dev/null +++ b/typo3/sysext/lang/classes/interfaces/interface.tx_lang_parser.php @@ -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 index 0000000000000000000000000000000000000000..1cb56255fe7d3f7f365b543a51076ca5103e47da --- /dev/null +++ b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_abstractxml.php @@ -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 index 0000000000000000000000000000000000000000..5295899e3124e23590c12b15194f9915a726ebaf --- /dev/null +++ b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_llphp.php @@ -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 index 0000000000000000000000000000000000000000..c003b1332f56f2affb29e336db4eff2f4fdf517d --- /dev/null +++ b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_llxml.php @@ -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 index 0000000000000000000000000000000000000000..14d6d85e7941adff40cfea355454b8a8d92ab48d --- /dev/null +++ b/typo3/sysext/lang/classes/parser/class.tx_lang_parser_xliff.php @@ -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 index 0000000000000000000000000000000000000000..57f4e1b9c92c4ba27e3ce92e8df7d206df49f9b5 --- /dev/null +++ b/typo3/sysext/lang/ext_autoload.php @@ -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 diff --git a/typo3/sysext/lang/lang.php b/typo3/sysext/lang/lang.php index 6d8943647a8df0393ef6c967b5fd39516f3895e6..800c10a7c01cdc803805ad6af80c34312d756eae 100755 --- a/typo3/sysext/lang/lang.php +++ b/typo3/sysext/lang/lang.php @@ -27,8 +27,6 @@ /** * Contains the TYPO3 Backend Language class * - * Revised for TYPO3 3.6.0 - * * @author Kasper SkÃ¥rhøj <kasperYYYY@typo3.com> */ /** @@ -70,41 +68,77 @@ * @see typo3/template.php, template */ class language { - // This is set to the language that is currently running for the user + + /** + * This is set to the language that is currently running for the user + * + * @var string + */ public $lang = 'default'; - // Values like the labels in the tables.php-document are split by '|'. - // This values defines which language is represented by which position - // in the resulting array after splitting a value. (NOTICE: Obsolete concept!) + + /** + * Values like the labels in the tables.php-document are split by '|'. + * This values defines which language is represented by which position + * in the resulting array after splitting a value. (NOTICE: Obsolete concept!) + * + * @var string + */ public $langSplit = 'default'; - // Default charset in backend - public $charSet = 'iso-8859-1'; + /** + * Default charset in backend + * + * @var string + */ + public $charSet = 'utf-8'; - // Array with alternative charsets for other languages. - // Moved to t3lib_cs, set internally from csConvObj! + /** + * Array with alternative charsets for other languages. + * Moved to t3lib_cs, set internally from csConvObj! + * + * @var array + */ public $charSetArray = array(); - // This is the url to the TYPO3 manual - public $typo3_help_url= 'http://www.typo3.com/man_uk/'; - - // Array with alternative URLs based on language. - public $helpUrlArray = array( - 'dk' => 'http://www.typo3.com/man_dk/', - ); + /** + * This is the url to the TYPO3 manual + * + * @var string + */ + public $typo3_help_url= 'http://typo3.org/documentation/document-library/'; - // If TRUE, will show the key/location of labels in the backend. + /** + * If TRUE, will show the key/location of labels in the backend. + * @var bool + */ public $debugKey = FALSE; - // Can contain labels and image references from the backend modules. - // Relies on t3lib_loadmodules to initialize modules after a global instance of $LANG has been created. + /** + * Can contain labels and image references from the backend modules. + * Relies on t3lib_loadmodules to initialize modules after a global instance of $LANG has been created. + * + * @var array + */ public $moduleLabels = array(); - // Internal - // Points to the position of the current language key as found in constant TYPO3_languages + /** + * Internal, Points to the position of the current language key as found in constant TYPO3_languages + * @var int + */ public $langSplitIndex = 0; - // Internal cache for read LL-files + + /** + * Internal cache for read LL-files + * + * @var array + */ public $LL_files_cache = array(); - // Internal cache for ll-labels (filled as labels are requested) + + /** + * Internal cache for ll-labels (filled as labels are requested) + * + * @var array + */ public $LL_labels_cache = array(); /** @@ -114,6 +148,12 @@ class language { */ public $csConvObj; + /** + * instance of the parser factory + * @var tx_lang_Factory + */ + public $parserFactory; + /** * Initializes the backend language. * This is for example done in typo3/template.php with lines like these: @@ -122,16 +162,19 @@ class language { * $LANG = t3lib_div::makeInstance('language'); * $LANG->init($GLOBALS['BE_USER']->uc['lang']); * - * @param string The language key (two character string from backend users profile) - * @param string IGNORE. Not used. - * @return void + * @throws RuntimeException + * @param string $lang The language key (two character string from backend users profile) + * @return void */ - public function init($lang, $altPath = '') { + public function init($lang) { // Initialize the conversion object: $this->csConvObj = t3lib_div::makeInstance('t3lib_cs'); $this->charSetArray = $this->csConvObj->charSetArray; + // Initialize the parser factory object + $this->parserFactory = t3lib_div::makeInstance('tx_lang_Factory'); + // Internally setting the list of TYPO3 backend languages. $this->langSplit = TYPO3_languages; @@ -146,10 +189,6 @@ class language { $this->langSplitIndex = $i; // The current language key $this->lang = $lang; - // The help URL if different from the default. - if ($this->helpUrlArray[$this->lang]) { - $this->typo3_help_url = $this->helpUrlArray[$this->lang]; - } if ($this->charSetArray[$this->lang]) { // The charset if different from the default. $this->charSet = $this->charSetArray[$this->lang]; @@ -157,6 +196,10 @@ class language { } } + if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lang']['debug']) { + $this->debugKey = TRUE; + } + // If a forced charset is used and different from the charset otherwise used: if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] && $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] != $this->charSet) { // Set the forced charset: @@ -168,15 +211,23 @@ class language { } } + /** + * Gets the parser factory. + * + * @return tx_lang_Factory + */ + public function getParserFactory() { + return $this->parserFactory; + } + /** * Adds labels and image references from the backend modules to the internal moduleLabels array * - * @param array Array with references to module labels, keys: ['labels']['tablabel'], - * ['labels']['tabdescr'], ['tabs']['tab'] - * @param string Module name prefix - * @return void - * @access public - * @see t3lib_loadModules + * @param array $arr Array with references to module labels, keys: ['labels']['tablabel'], + * ['labels']['tabdescr'], ['tabs']['tab'] + * @param string $prefix Module name prefix + * @return void + * @see t3lib_loadModules */ public function addModuleLabels($arr, $prefix) { if (is_array($arr)) { @@ -198,10 +249,10 @@ class language { * will also have taken place if needed (see init()) * Used to pipe language labels through just before they are returned. * - * @param string The string to process - * @param boolean If set, then the string is htmlspecialchars()'ed - * @return string The processed string - * @see init() + * @param string $lStr The string to process + * @param boolean $hsc If set, then the string is htmlspecialchars()'ed + * @return string The processed string + * @see init() * @access public */ public function hscAndCharConv($lStr, $hsc) { @@ -223,8 +274,8 @@ class language { * is used in the document otherwise (only MSIE, Mozilla is OK). * So by converting we by-pass this problem. * - * @param string Input string - * @return string Output string + * @param string $str Input string + * @return string Output string * @access public */ public function makeEntities($str) { @@ -245,8 +296,8 @@ class language { * rawurlencode() in order to pass strings in a safe way. This could still be done * for iso-8859-1 charsets but now I have applied the same method here for all charsets. * - * @param string Input string, encoded with $this->charSet - * @return string Output string, a JavaScript function: "String.fromCharCode(......)" + * @param string $str Input string, encoded with $this->charSet + * @return string Output string, a JavaScript function: "String.fromCharCode(......)" * @access public */ public function JScharCode($str) { @@ -262,47 +313,53 @@ class language { return 'String.fromCharCode(' . implode(',', $nArr) . ')'; } + /** + * Debugs localization key. + * + * @param $value Value to debug + * @return string + */ + public function debugLL($value) { + return ($this->debugKey ? '[' . $value . ']' : ''); + } + /** * Returns the label with key $index form the globally loaded $LOCAL_LANG array. * Mostly used from modules with only one LOCAL_LANG file loaded into the global space. * - * @param string Label key - * @param boolean If set, the return value is htmlspecialchar'ed + * @param string $index Label key + * @param boolean $hsc If set, the return value is htmlspecialchar'ed * @return string * @access public */ - public function getLL($index, $hsc = 0) { + public function getLL($index, $hsc = FALSE) { // Get Local Language - if (strcmp($GLOBALS['LOCAL_LANG'][$this->lang][$index], '')) { - // Returns local label if not blank. - $output = $this->hscAndCharConv($GLOBALS['LOCAL_LANG'][$this->lang][$index], $hsc); + if ($GLOBALS['LOCAL_LANG'][$this->lang][$index][0]['target'] !== '') { + $output = $this->hscAndCharConv($GLOBALS['LOCAL_LANG'][$this->lang][$index][0]['target'], $hsc); } else { - // Returns default label - $output = $this->hscAndCharConv($GLOBALS['LOCAL_LANG']['default'][$index], $hsc); + $output = $this->hscAndCharConv($GLOBALS['LOCAL_LANG']['default'][$index][0]['target'], $hsc); } - return $output . ($this->debugKey ? ' [' . $index . ']' : ''); + return $output . $this->debugLL($index); } /** * Works like ->getLL() but takes the $LOCAL_LANG array * used as the second argument instead of using the global array. * - * @param string Label key - * @param array $LOCAL_LANG array to get label key from - * @param boolean If set, the return value is htmlspecialchar'ed + * @param string $index Label key + * @param array $localLanguage $LOCAL_LANG array to get label key from + * @param boolean $hsc If set, the return value is htmlspecialchar'ed * @return string * @access public */ - public function getLLL($index, $LOCAL_LANG, $hsc = 0) { + public function getLLL($index, $localLanguage, $hsc = FALSE) { // Get Local Language - if (strcmp($LOCAL_LANG[$this->lang][$index], '')) { - // Returns local label if not blank. - $output = $this->hscAndCharConv($LOCAL_LANG[$this->lang][$index], $hsc); + if ($localLanguage[$this->lang][$index][0]['target'] !== '') { + $output = $this->hscAndCharConv($localLanguage[$this->lang][$index][0]['target'], $hsc); } else { - // Returns default label - $output = $this->hscAndCharConv($LOCAL_LANG['default'][$index], $hsc); + $output = $this->hscAndCharConv($localLanguage['default'][$index][0]['target'], $hsc); } - return $output . ($this->debugKey ? ' [' . $index . ']' : ''); + return $output . $this->debugLL($index); } /** @@ -315,13 +372,13 @@ class language { * (and thereby it's highly deprecated to use 'language-splitted' label strings) * Refer to 'Inside TYPO3' for more details * - * @param string Label key/reference - * @param boolean If set, the return value is htmlspecialchar'ed + * @param string $input Label key/reference + * @param boolean $hsc If set, the return value is htmlspecialchar'ed * @return string * @access public */ - public function sL($input, $hsc = 0) { - // Using obsolete 'language-splitted' labels: + public function sL($input, $hsc = FALSE) { + // Using obsolete 'language-splitted' labels: if (strcmp(substr($input, 0, 4), 'LLL:')) { $t = explode('|', $input); $out = $t[$this->langSplitIndex] ? $t[$this->langSplitIndex] : $t[0]; @@ -370,7 +427,7 @@ class language { if ($hsc) { $output = t3lib_div::deHSCentities(htmlspecialchars($output)); } - return $output . ($this->debugKey ? ' [' . $input . ']' : ''); + return $output . $this->debugLL($input); } } @@ -379,29 +436,28 @@ class language { * as defined in $TCA_DESCR[$table]['refs'] * $TCA_DESCR is a global var * - * @param string Table name found as key in global array $TCA_DESCR + * @param string $table Table name found as key in global array $TCA_DESCR * @return void * @access public */ public function loadSingleTableDescription($table) { - global $TCA_DESCR; // First the 'table' cannot already be loaded in [columns] // and secondly there must be a references to locallang files available in [refs] - if (is_array($TCA_DESCR[$table]) - && !isset($TCA_DESCR[$table]['columns']) - && is_array($TCA_DESCR[$table]['refs'])) { + if (is_array($GLOBALS['TCA_DESCR'][$table]) + && !isset($GLOBALS['TCA_DESCR'][$table]['columns']) + && is_array($GLOBALS['TCA_DESCR'][$table]['refs'])) { // Init $TCA_DESCR for $table-key - $TCA_DESCR[$table]['columns'] = array(); + $GLOBALS['TCA_DESCR'][$table]['columns'] = array(); // Get local-lang for each file in $TCA_DESCR[$table]['refs'] as they are ordered. - foreach ($TCA_DESCR[$table]['refs'] as $llfile) { - $LOCAL_LANG = $this->includeLLFile($llfile, 0, 1); + foreach ($GLOBALS['TCA_DESCR'][$table]['refs'] as $llfile) { + $localLanguage = $this->includeLLFile($llfile, 0, 1); // Traverse all keys - if (is_array($LOCAL_LANG['default'])) { - foreach ($LOCAL_LANG['default'] as $lkey => $lVal) { + if (is_array($localLanguage['default'])) { + foreach ($localLanguage['default'] as $lkey => $lVal) { $type = ''; $fieldName = ''; @@ -439,10 +495,10 @@ class language { // Append label if ($specialInstruction) { - $TCA_DESCR[$table]['columns'][$fieldName][$type] .= LF . $lVal; + $GLOBALS['TCA_DESCR'][$table]['columns'][$fieldName][$type] .= LF . $lVal[0]['source']; } else { // Substitute label - $TCA_DESCR[$table]['columns'][$fieldName][$type] = $lVal; + $GLOBALS['TCA_DESCR'][$table]['columns'][$fieldName][$type] = $lVal[0]['source']; } } } @@ -454,61 +510,58 @@ class language { * Includes locallang file (and possibly additional localized version if configured for) * Read language labels will be merged with $LOCAL_LANG (if $setGlobal = TRUE). * - * @param string $fileRef is a file-reference (see t3lib_div::getFileAbsFileName) - * @param boolean Setting in global variable $LOCAL_LANG (or returning the variable) - * @param boolean If $mergeLocalOntoDefault is set the local part of the $LOCAL_LANG array is merged onto the default part (if the local part exists) and the local part is unset. - * @return mixed If $setGlobal is TRUE the LL-files will set the $LOCAL_LANG in the global scope. Otherwise the $LOCAL_LANG array is returned from function + * @param string $fileRef $fileRef is a file-reference (see t3lib_div::getFileAbsFileName) + * @param boolean $setGlobal Setting in global variable $LOCAL_LANG (or returning the variable) + * @param boolean $mergeLocalOntoDefault If $mergeLocalOntoDefault is set the local part of the $LOCAL_LANG array is merged onto the default part (if the local part exists) and the local part is unset. + * @return mixed If $setGlobal is TRUE the LL-files will set the $LOCAL_LANG in the global scope. Otherwise the $LOCAL_LANG array is returned from function * @access public */ - public function includeLLFile($fileRef, $setGlobal = 1, $mergeLocalOntoDefault = 0) { - // Configure for global flag: - if ($setGlobal) { - global $LOCAL_LANG; - } + public function includeLLFile($fileRef, $setGlobal = TRUE, $mergeLocalOntoDefault = FALSE) { + + $globalLanguage = array(); // Get default file - $llang = $this->readLLfile($fileRef); + $localLanguage = $this->readLLfile($fileRef); - if (is_array($llang) && count($llang)) { + if (is_array($localLanguage) && count($localLanguage)) { - $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule((array)$LOCAL_LANG, $llang); + // it depends on, whether we should return the result or set it in the global $LOCAL_LANG array + if ($setGlobal) { + $globalLanguage = t3lib_div::array_merge_recursive_overrule((array)$GLOBALS['LOCAL_LANG'], $localLanguage); + } else { + $globalLanguage = $localLanguage; + } // Localized addition? $lFileRef = $this->localizedFileRef($fileRef); - if ($lFileRef && (string)$LOCAL_LANG[$this->lang] == 'EXT') { - $llang = $this->readLLfile($lFileRef); - $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG, $llang); - } - - // Overriding file? - // @deprecated since TYPO3 4.3, remove in TYPO3 4.5, please use the generic method in - // t3lib_div::readLLfile and the global array $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride'] - if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$fileRef])) { - t3lib_div::deprecationLog('Usage of $TYPO3_CONF_VARS[\'BE\'][\'XLLfile\'] is deprecated since TYPO3 4.3. Use $TYPO3_CONF_VARS[\'SYS\'][\'locallangXMLOverride\'][] to include the file ' . $fileRef . ' instead.'); - $ORarray = $this->readLLfile($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$fileRef]); - $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG, $ORarray); + if ($lFileRef && (string)$globalLanguage[$this->lang] == 'EXT') { + $localLanguage = $this->readLLfile($lFileRef); + $globalLanguage = t3lib_div::array_merge_recursive_overrule($globalLanguage, $localLanguage); } // Merge local onto default - if ($mergeLocalOntoDefault && strcmp($this->lang, 'default') && is_array($LOCAL_LANG[$this->lang]) && is_array($LOCAL_LANG['default'])) { + if ($mergeLocalOntoDefault && $this->lang !== 'default' + && is_array($globalLanguage[$this->lang]) && is_array($globalLanguage['default'])) { // array_merge can be used so far the keys are not // numeric - which we assume they are not... - $LOCAL_LANG['default'] = array_merge($LOCAL_LANG['default'], $LOCAL_LANG[$this->lang]); - unset($LOCAL_LANG[$this->lang]); + $globalLanguage['default'] = array_merge($globalLanguage['default'], $globalLanguage[$this->lang]); + unset($globalLanguage[$this->lang]); } } // Return value if not global is set. if (!$setGlobal) { - return $LOCAL_LANG; + return $globalLanguage; + } else { + $GLOBALS['LOCAL_LANG'] = $globalLanguage; } } /** * Includes a locallang file and returns the $LOCAL_LANG array found inside. * - * @param string Input is a file-reference (see t3lib_div::getFileAbsFileName) which, if exists, is included. That file is expected to be a 'local_lang' file containing a $LOCAL_LANG array. - * @return array Value of $LOCAL_LANG found in the included file. If that array is found it's returned. Otherwise an empty array + * @param string $fileRef Input is a file-reference (see t3lib_div::getFileAbsFileName) which, if exists, is included. That file is expected to be a 'local_lang' file containing a $LOCAL_LANG array. + * @return array Value of $LOCAL_LANG found in the included file. If that array is found it's returned. Otherwise an empty array * @access private */ protected function readLLfile($fileRef) { @@ -518,8 +571,8 @@ class language { /** * Returns localized fileRef (.[langkey].php) * - * @param string Filename/path of a 'locallang.php' file - * @return string Input filename with a '.[lang-key].php' ending added if $this->lang is not 'default' + * @param string $fileRef Filename/path of a 'locallang.php' file + * @return string Input filename with a '.[lang-key].php' ending added if $this->lang is not 'default' * @access private */ protected function localizedFileRef($fileRef) { @@ -527,6 +580,26 @@ class language { return substr($fileRef, 0, -4) . '.' . $this->lang . '.php'; } } + + /** + * Overrides a label. + * + * @param string $index + * @param string $value + * @param boolean $overrideDefault Overrides default language + * @return void + */ + public function overrideLL($index, $value, $overrideDefault = TRUE) { + if (isset($GLOBALS['LOCAL_LANG']) === FALSE) { + $GLOBALS['LOCAL_LANG'] = array(); + } + + $GLOBALS['LOCAL_LANG'][$this->lang][$index][0]['target'] = $value; + + if ($overrideDefault) { + $GLOBALS['LOCAL_LANG']['default'][$index][0]['target'] = $value; + } + } } diff --git a/typo3/sysext/lang/res/js/be/typo3lang.js b/typo3/sysext/lang/res/js/be/typo3lang.js new file mode 100644 index 0000000000000000000000000000000000000000..1cf53987a6f2e9821f3022ac1c4393ed5779b87d --- /dev/null +++ b/typo3/sysext/lang/res/js/be/typo3lang.js @@ -0,0 +1,56 @@ +/*************************************************************** + * Copyright notice + * + * (c) 2010 Dominique Feyer <dominique.feyer@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! + ***************************************************************/ + +Ext.ns('TYPO3.l10n'); + +TYPO3.l10n = { + + localize: function(label, replace, plural) { + if (typeof TYPO3.lang === 'undefined' || typeof TYPO3.lang[label] === 'undefined') return false; + + var i = plural || 0, + translationUnit = TYPO3.lang[label], + label = null, regexp = null; + + // Get localized label + if (Ext.isString(translationUnit)) { + label = translationUnit; + } else { + label = translationUnit[i]['target']; + } + + // Replace + if (typeof replace !== 'undefined') { + for (key in replace) { + regexp = new RegExp('%' + key + '|%s'); + label = label.replace(regexp, replace[key]); + } + } + + return label; + } + +} \ No newline at end of file diff --git a/typo3/sysext/recycler/res/js/t3_recycler.js b/typo3/sysext/recycler/res/js/t3_recycler.js index 95dea5243500c04dc895da9858a3d013d18f98bf..d8c26f037b78d117c67a2e70e935838351bc2138 100644 --- a/typo3/sysext/recycler/res/js/t3_recycler.js +++ b/typo3/sysext/recycler/res/js/t3_recycler.js @@ -40,11 +40,11 @@ Ext.ns('Recycler'); Recycler.Expander = new Ext.grid.RowExpander({ tpl : new Ext.Template( '<dl class="recycler-table-list-entry-details">' + - '<dt>' + TYPO3.lang.table + ': </dt><dd>{table}</dd>' + - '<dt>' + TYPO3.lang.crdate + ': </dt><dd>{crdate}</dd>' + - '<dt>' + TYPO3.lang.tstamp + ': </dt><dd>{tstamp}</dd>' + - '<dt>' + TYPO3.lang.owner + ': </dt><dd>{owner} (UID: {owner_uid})</dd>' + - '<dt>' + TYPO3.lang.path + ': </dt><dd>{path}</dd>' + + '<dt>' + TYPO3.l10n.localize('table') + ': </dt><dd>{table}</dd>' + + '<dt>' + TYPO3.l10n.localize('crdate') + ': </dt><dd>{crdate}</dd>' + + '<dt>' + TYPO3.l10n.localize('tstamp') + ': </dt><dd>{tstamp}</dd>' + + '<dt>' + TYPO3.l10n.localize('owner') + ': </dt><dd>{owner} (UID: {owner_uid})</dd>' + + '<dt>' + TYPO3.l10n.localize('path') + ': </dt><dd>{path}</dd>' + '</dl>' ) }); @@ -148,7 +148,7 @@ Recycler.ConfirmWindow = Ext.extend(Ext.Window, { text: this.confirmQuestion }, { xtype: 'checkbox', - boxLabel: TYPO3.lang.boxLabel_undelete_recursive, + boxLabel: TYPO3.l10n.localize('boxLabel_undelete_recursive'), name: 'recursiveCheckbox', disabled: !this.showRecursiveCheckbox, itemId: 'recursiveCheck', @@ -157,7 +157,7 @@ Recycler.ConfirmWindow = Ext.extend(Ext.Window, { ], buttons: [ { - text: TYPO3.lang.yes, + text: TYPO3.l10n.localize('yes'), scope: this, handler: function(button, event) { var tcemainData = []; @@ -193,7 +193,7 @@ Recycler.ConfirmWindow = Ext.extend(Ext.Window, { this.close(); } },{ - text: TYPO3.lang.no, + text: TYPO3.l10n.localize('no'), scope: this, handler: function(button, event) { this.close(); @@ -235,9 +235,9 @@ Recycler.Utility = { function_delete: function(button, event) { Recycler.Utility.rowAction( 'doDelete', - TYPO3.lang.cmd_doDelete_confirmText, - TYPO3.lang.title_delete, - TYPO3.lang.text_delete + TYPO3.l10n.localize('cmd_doDelete_confirmText'), + TYPO3.l10n.localize('title_delete'), + TYPO3.l10n.localize('text_delete') ); }, @@ -248,9 +248,9 @@ Recycler.Utility = { function_undelete: function(button, event) { Recycler.Utility.rowAction( 'doUndelete', - TYPO3.lang.sure, - TYPO3.lang.title_undelete, - TYPO3.lang.text_undelete + TYPO3.l10n.localize('sure'), + TYPO3.l10n.localize('title_undelete'), + TYPO3.l10n.localize('text_undelete') ); }, @@ -295,8 +295,8 @@ Recycler.Utility = { } else { // no row selected Ext.MessageBox.show({ - title: TYPO3.lang.error_NoSelectedRows_title, - msg: TYPO3.lang.error_NoSelectedRows_msg, + title: TYPO3.l10n.localize('error_NoSelectedRows_title'), + msg: TYPO3.l10n.localize('error_NoSelectedRows_msg'), buttons: Ext.MessageBox.OK, minWidth: 300, minHeight: 200, @@ -349,8 +349,8 @@ Recycler.GridContainer = Ext.extend(Ext.grid.GridPanel, { Recycler.Expander, {header: "UID", width: 10, sortable: true, dataIndex: 'uid'}, {header: "PID", width: 10, sortable: true, dataIndex: 'pid'}, - {id: 'record', header: TYPO3.lang.records, width: 60, sortable: true, dataIndex: 'record', renderer: Recycler.Utility.renderTopic}, - {id: 'table', header: TYPO3.lang.table, width: 20, sortable: true, dataIndex: 'tableTitle'} + {id: 'record', header: TYPO3.l10n.localize('records'), width: 60, sortable: true, dataIndex: 'record', renderer: Recycler.Utility.renderTopic}, + {id: 'table', header: TYPO3.l10n.localize('table'), width: 20, sortable: true, dataIndex: 'tableTitle'} ]), viewConfig: { forceFit: true @@ -368,8 +368,8 @@ Recycler.GridContainer = Ext.extend(Ext.grid.GridPanel, { store: Recycler.MainStore, pageSize: TYPO3.settings.Recycler.pagingSize, displayInfo: true, - displayMsg: TYPO3.lang.pagingMessage, - emptyMsg: TYPO3.lang.pagingEmpty + displayMsg: TYPO3.l10n.localize('pagingMessage'), + emptyMsg: TYPO3.l10n.localize('pagingEmpty') }, '-', { /**************************************************** * Delete button @@ -377,8 +377,8 @@ Recycler.GridContainer = Ext.extend(Ext.grid.GridPanel, { xtype: 'button', width: 80, id: 'deleteButton', - text: TYPO3.lang.deleteButton_text, - tooltip: TYPO3.lang.deleteButton_tooltip, + text: TYPO3.l10n.localize('deleteButton_text'), + tooltip: TYPO3.l10n.localize('deleteButton_tooltip'), iconCls: 'delete', disabled: TYPO3.settings.Recycler.deleteDisable, handler: Recycler.Utility.function_delete @@ -389,22 +389,22 @@ Recycler.GridContainer = Ext.extend(Ext.grid.GridPanel, { xtype: 'button', width: 80, id: 'undeleteButton', - text: TYPO3.lang.undeleteButton_text, - tooltip: TYPO3.lang.undeleteButton_tooltip, + text: TYPO3.l10n.localize('undeleteButton_text'), + tooltip: TYPO3.l10n.localize('undeleteButton_tooltip'), iconCls: 'undelete', handler: Recycler.Utility.function_undelete } ], tbar: [ - TYPO3.lang.search, ' ', + TYPO3.l10n.localize('search'), ' ', new Ext.app.SearchField({ store: Recycler.MainStore, width: 200 }), '-', { xtype: 'tbtext', - text: TYPO3.lang.depth + ':' + text: TYPO3.l10n.localize('depth') + ':' },{ /**************************************************** @@ -421,22 +421,22 @@ Recycler.GridContainer = Ext.extend(Ext.grid.GridPanel, { displayField: 'label', id: 'depthSelector', mode: 'local', - emptyText: TYPO3.lang.depth, + emptyText: TYPO3.l10n.localize('depth'), selectOnFocus: true, triggerAction: 'all', editable: false, forceSelection: true, - hidden: TYPO3.lang.showDepthMenu, + hidden: TYPO3.l10n.localize('showDepthMenu'), store: new Ext.data.SimpleStore({ autoLoad: true, fields: ['depth','label'], data : [ - ['0', TYPO3.lang.depth_0], - ['1', TYPO3.lang.depth_1], - ['2', TYPO3.lang.depth_2], - ['3', TYPO3.lang.depth_3], - ['4', TYPO3.lang.depth_4], - ['999', TYPO3.lang.depth_infi] + ['0', TYPO3.l10n.localize('depth_0')], + ['1', TYPO3.l10n.localize('depth_1')], + ['2', TYPO3.l10n.localize('depth_2')], + ['3', TYPO3.l10n.localize('depth_3')], + ['4', TYPO3.l10n.localize('depth_4')], + ['999', TYPO3.l10n.localize('depth_infi')] ] }), value: TYPO3.settings.Recycler.depthSelection, @@ -461,7 +461,7 @@ Recycler.GridContainer = Ext.extend(Ext.grid.GridPanel, { } },'-',{ xtype: 'tbtext', - text: TYPO3.lang.tableMenu_label + text: TYPO3.l10n.localize('tableMenu_label') },{ /**************************************************** @@ -478,14 +478,14 @@ Recycler.GridContainer = Ext.extend(Ext.grid.GridPanel, { id: 'tableSelector', width: 220, mode: 'local', - emptyText: TYPO3.lang.tableMenu_emptyText, + emptyText: TYPO3.l10n.localize('tableMenu_emptyText'), selectOnFocus: true, triggerAction: 'all', editable: false, forceSelection: true, store: Recycler.TableStore, - valueNotFoundText: String.format(TYPO3.lang.noValueFound, TYPO3.settings.Recycler.tableSelection), + valueNotFoundText: String.format(TYPO3.l10n.localize('noValueFound'), TYPO3.settings.Recycler.tableSelection), tpl: '<tpl for="."><tpl if="records > 0"><div ext:qtip="{table} ({records})" class="x-combo-list-item">{tableTitle} ({records}) </div></tpl><tpl if="records < 1"><div ext:qtip="{table} ({records})" class="x-combo-list-item x-item-disabled">{tableTitle} ({records}) </div></tpl></tpl>', listeners: { 'select': { diff --git a/typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js b/typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js index 72e05d267a3d49b00b996aded2cec829759d756d..48ab09722ee9d55a5744a33d6e0ce0da68dbd223 100644 --- a/typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js +++ b/typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js @@ -54,8 +54,12 @@ Ext.apply(HTMLArea, { /*************************************************** * LOCALIZATION * ***************************************************/ - localize: function (label) { - return HTMLArea.I18N.dialogs[label] || HTMLArea.I18N.tooltips[label] || HTMLArea.I18N.msg[label] || ''; + localize: function (label, plural) { + var i = plural || 0; + var label = HTMLArea.I18N.dialogs[label] || HTMLArea.I18N.tooltips[label] || HTMLArea.I18N.msg[label] || ''; + if (label[i] != undefined) { + return label[i]['target']; + } }, /*************************************************** * INITIALIZATION * @@ -524,7 +528,7 @@ Ext.ux.form.HTMLAreaCombo = Ext.extend(Ext.form.ComboBox, { // Invoke the plugin onChange handler this.plugins[this.action](editor, combo, record, index); // In IE, bookmark the updated selection as the editor will be loosing focus - if (Ext.isIE) { + if (Ext.isIE) { editor.focus(); this.savedRange = editor._createRange(editor._getSelection()); this.triggered = true; @@ -1462,13 +1466,13 @@ HTMLArea.StatusBar = Ext.extend(Ext.Container, { id: this.editorId + '-statusBarTree', tag: 'span', cls: 'statusBarTree', - html: HTMLArea.I18N.msg['Path'] + ': ' + html: HTMLArea.localize('Path') + ': ' }, true).setVisibilityMode(Ext.Element.DISPLAY).setVisible(true); this.statusBarTextMode = Ext.DomHelper.append(this.getEl(), { id: this.editorId + '-statusBarTextMode', tag: 'span', cls: 'statusBarTextMode', - html: HTMLArea.I18N.msg['TEXT_MODE'] + html: HTMLArea.localize('TEXT_MODE') }, true).setVisibilityMode(Ext.Element.DISPLAY).setVisible(false); }, /* @@ -1501,7 +1505,7 @@ HTMLArea.StatusBar = Ext.extend(Ext.Container, { this.clear(); var path = Ext.DomHelper.append(this.statusBarTree, { tag: 'span', - html: HTMLArea.I18N.msg['Path'] + ': ' + html: HTMLArea.localize('Path') + ': ' },true); Ext.each(ancestors, function (ancestor, index) { if (!ancestor) { @@ -1531,7 +1535,7 @@ HTMLArea.StatusBar = Ext.extend(Ext.Container, { var element = Ext.DomHelper.insertAfter(path, { tag: 'a', href: '#', - 'ext:qtitle': HTMLArea.I18N.dialogs['statusBarStyle'], + 'ext:qtitle': HTMLArea.localize('statusBarStyle'), 'ext:qtip': ancestor.style.cssText.split(';').join('<br />'), html: text }, true); @@ -1579,7 +1583,7 @@ HTMLArea.StatusBar = Ext.extend(Ext.Container, { } } // Update the word count of the status bar - this.statusBarWordCount.dom.innerHTML = wordCount ? ( wordCount + ' ' + HTMLArea.I18N.dialogs[(wordCount == 1) ? 'word' : 'words']) : ' '; + this.statusBarWordCount.dom.innerHTML = wordCount ? ( wordCount + ' ' + HTMLArea.localize((wordCount == 1) ? 'word' : 'words')) : ' '; }, /* * Adapt status bar to current editor mode @@ -2172,7 +2176,7 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, { this.appendToLog('HTMLArea.Editor', 'setMode', 'The HTML document is not well-formed.', 'warn'); TYPO3.Dialog.ErrorDialog({ title: 'htmlArea RTE', - msg: HTMLArea.I18N.msg['HTML-document-not-well-formed'] + msg: HTMLArea.localize('HTML-document-not-well-formed') }); break; } @@ -2923,7 +2927,7 @@ HTMLArea.getHTML = function(root, outputRoot, editor){ editor.appendToLog('HTMLArea', 'getHTML', 'The HTML document is not well-formed.', 'warn'); TYPO3.Dialog.ErrorDialog({ title: 'htmlArea RTE', - msg: HTMLArea.I18N.msg['HTML-document-not-well-formed'] + msg: HTMLArea.localize('HTML-document-not-well-formed') }); return editor.document.body.innerHTML; } @@ -3415,7 +3419,7 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, { } } else { if (Ext.isIE) { - try { + try { var rules = this.editor.document.styleSheets[0].rules; var imports = this.editor.document.styleSheets[0].imports; if ((!rules || !rules.length) && (!imports || !imports.length)) { @@ -3427,7 +3431,7 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, { this.error = e; } } else { - try { + try { this.editor.document.styleSheets && this.editor.document.styleSheets[0] && this.editor.document.styleSheets[0].rules; } catch(e) { this.cssLoaded = false; @@ -3438,7 +3442,7 @@ HTMLArea.CSS.Parser = Ext.extend(Ext.util.Observable, { if (this.cssLoaded) { if (this.editor.document.styleSheets.length) { Ext.each(this.editor.document.styleSheets, function (styleSheet) { - try { + try { if (Ext.isIE) { if (styleSheet.imports) { this.parseIeRules(styleSheet.imports); @@ -3997,7 +4001,7 @@ HTMLArea.Plugin = function (editor, pluginName) { /** *********************************************** * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.6 * - *********************************************** + *********************************************** * Extends class HTMLArea.Plugin * * Defined for backward compatibility only @@ -4030,7 +4034,7 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, { /** *********************************************** * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.6 * - *********************************************** + *********************************************** * Extends class HTMLArea[pluginName] * * Defined for backward compatibility only @@ -4058,7 +4062,7 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, { /** *********************************************** * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.6 * - *********************************************** + *********************************************** * Invove the base class constructor * * Defined for backward compatibility only @@ -4363,7 +4367,7 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, { * @return string the localization of the label */ localize: function (label) { - return this.I18N[label] || HTMLArea.localize(label); + return HTMLArea.localize(label); }, /** * Get localized label wrapped with contextual help markup when available @@ -4600,7 +4604,7 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, { * * @param string button: the text of the button * @param function handler: button handler - * + * * @return object the button configuration object */ buildButtonConfig: function (button, handler) { diff --git a/typo3/sysext/setup/mod/index.php b/typo3/sysext/setup/mod/index.php index 69b171849b9af40f136b58509ab85ee551dbbd4c..20668bb842e7bd93023ced13fdacc52cdc001bf0 100755 --- a/typo3/sysext/setup/mod/index.php +++ b/typo3/sysext/setup/mod/index.php @@ -775,24 +775,28 @@ class SC_mod_user_setup_index { */ public function renderLanguageSelect($params, $pObj) { + $languageOptions = array(); + // compile the languages dropdown - $languageOptions = array( - '000000000' => LF . '<option value="">' . $GLOBALS['LANG']->getLL('lang_default', 1) . '</option>' - ); + $langDefault = $GLOBALS['LANG']->getLL('lang_default', 1); + $languageOptions[$langDefault] = '<option value="">' . $langDefault . '</option>'; + // traverse the number of languages $theLanguages = t3lib_div::trimExplode('|', TYPO3_languages); foreach ($theLanguages as $language) { if ($language != 'default') { - $languageValue = $GLOBALS['LOCAL_LANG']['default']['lang_' . $language]; + $languageValue = $GLOBALS['LOCAL_LANG']['default']['lang_' . $language][0]['source']; $localLabel = ' - ['.htmlspecialchars($languageValue) . ']'; $unavailable = (is_dir(PATH_typo3conf . 'l10n/' . $language) ? FALSE : TRUE); if (!$unavailable) { - $languageOptions[$languageValue . '--' . $language] = ' - <option value="'.$language.'"'.($GLOBALS['BE_USER']->uc['lang'] == $language ? ' selected="selected"' : '') . ($unavailable ? ' class="c-na"' : '').'>'.$GLOBALS['LANG']->getLL('lang_' . $language, 1) . $localLabel . '</option>'; + $languageOptions[$languageValue] = '<option value="'.$language.'"'.($GLOBALS['BE_USER']->uc['lang'] == $language ? + ' selected="selected"' : '') . ($unavailable ? ' class="c-na"' : '') . '>' . + $GLOBALS['LANG']->getLL('lang_' . $language, 1) . $localLabel . '</option>'; } } } ksort($languageOptions); + $languageCode = ' <select id="field_lang" name="data[lang]" class="select">' . implode('', $languageOptions) . '