[TASK] Move typo3lang.js to Resources/Public/JavaScript 60/21160/2
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 29 May 2013 18:28:56 +0000 (20:28 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 3 Jun 2013 06:17:16 +0000 (08:17 +0200)
Move typo3/sysext/lang/res/js/be/typo3lang.js to
typo3/sysext/Resources/Public/JavaScript/Typo3Lang.js

Change-Id: I1541e377a49ac0cd3d43a222c4ca87b71268cce2
Resolves: #48655
Releases: 6.2
Reviewed-on: https://review.typo3.org/21160
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/lang/Resources/Public/JavaScript/Typo3Lang.js [new file with mode: 0644]
typo3/sysext/lang/res/js/be/typo3lang.js [deleted file]
typo3/sysext/workspaces/Classes/Controller/PreviewController.php

index 9635503..8ee8108 100644 (file)
@@ -2183,7 +2183,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
                        unset($this->extOnReadyCode);
                        // Include TYPO3.l10n 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;
+                               $out .= '<script src="' . $this->processJsFile(($this->backPath . 'sysext/lang/Resources/Public/JavaScript/Typo3Lang.js')) . '" type="text/javascript" charset="utf-8"></script>' . LF;
                        }
                        if ($this->extJStheme) {
                                if (isset($GLOBALS['TBE_STYLES']['extJS']['theme'])) {
diff --git a/typo3/sysext/lang/Resources/Public/JavaScript/Typo3Lang.js b/typo3/sysext/lang/Resources/Public/JavaScript/Typo3Lang.js
new file mode 100644 (file)
index 0000000..7d41e7f
--- /dev/null
@@ -0,0 +1,85 @@
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 Dominique Feyer <dominique.feyer@reelpeek.net>
+ *  Laurent Cherpit <laurent.cherpit@gmail.com>
+ *  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 = function() {
+
+       /**
+        * Protected copy of translationUnits
+        * @private
+        */
+       var lang = [],
+
+       sanitize = function() {
+               if (typeof TYPO3.lang !== 'undefined') {
+                       for (key in TYPO3.lang) {
+                               lang[key] = TYPO3.lang[key];
+
+                               if (!Ext.isString(TYPO3.lang[key])) {
+                                       TYPO3.lang[key] = TYPO3.lang[key][0].target;
+                               }
+                       }
+               }
+       };
+
+       return {
+
+               initialize: function() {
+                       sanitize();
+               },
+
+               localize: function(label, replace, plural) {
+                       if (typeof lang === 'undefined' || typeof lang[label] === 'undefined') {
+                               return false;
+                       }
+
+                       var i = plural || 0,
+                                       translationUnit = 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;
+               }
+       };
+}();
+
+TYPO3.l10n.initialize();
\ No newline at end of file
diff --git a/typo3/sysext/lang/res/js/be/typo3lang.js b/typo3/sysext/lang/res/js/be/typo3lang.js
deleted file mode 100644 (file)
index 7d41e7f..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010 Dominique Feyer <dominique.feyer@reelpeek.net>
- *  Laurent Cherpit <laurent.cherpit@gmail.com>
- *  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 = function() {
-
-       /**
-        * Protected copy of translationUnits
-        * @private
-        */
-       var lang = [],
-
-       sanitize = function() {
-               if (typeof TYPO3.lang !== 'undefined') {
-                       for (key in TYPO3.lang) {
-                               lang[key] = TYPO3.lang[key];
-
-                               if (!Ext.isString(TYPO3.lang[key])) {
-                                       TYPO3.lang[key] = TYPO3.lang[key][0].target;
-                               }
-                       }
-               }
-       };
-
-       return {
-
-               initialize: function() {
-                       sanitize();
-               },
-
-               localize: function(label, replace, plural) {
-                       if (typeof lang === 'undefined' || typeof lang[label] === 'undefined') {
-                               return false;
-                       }
-
-                       var i = plural || 0,
-                                       translationUnit = 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;
-               }
-       };
-}();
-
-TYPO3.l10n.initialize();
\ No newline at end of file
index aaeadd2..8a64589 100644 (file)
@@ -141,8 +141,8 @@ class PreviewController extends \TYPO3\CMS\Workspaces\Controller\AbstractControl
                $this->pageRenderer->addInlineSetting('Workspaces', 'disableNextStageButton', $this->isInvalidStage($nextStage));
                $this->pageRenderer->addInlineSetting('Workspaces', 'disablePreviousStageButton', $this->isInvalidStage($previousStage));
                $this->pageRenderer->addInlineSetting('Workspaces', 'disableDiscardStageButton', $this->isInvalidStage($nextStage) && $this->isInvalidStage($previousStage));
-               $resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('lang') . 'res/js/be/';
-               $this->pageRenderer->addJsFile($resourcePath . 'typo3lang.js');
+               $resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('lang') . 'Resources/Public/JavaScript/';
+               $this->pageRenderer->addJsFile($resourcePath . 'Typo3Lang.js');
                $this->pageRenderer->addJsInlineCode('workspaces.preview.lll', '
                TYPO3.lang = {
                        visualPreview: ' . Utility\GeneralUtility::quoteJSvalue($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.visualPreview', TRUE)) . ',