Fixed bug #11841: Hardcoded labels in t3editor (thanks to Christopher Stelmaszyk)
authorTobias Liebig <mail@etobi.de>
Mon, 7 Sep 2009 09:04:58 +0000 (09:04 +0000)
committerTobias Liebig <mail@etobi.de>
Mon, 7 Sep 2009 09:04:58 +0000 (09:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5906 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/t3editor/class.tx_t3editor.php
typo3/sysext/t3editor/lib/ts_codecompletion/class.tx_t3editor_codecompletion.php
typo3/sysext/t3editor/lib/ts_codecompletion/class.tx_t3editor_tsrefloader.php
typo3/sysext/t3editor/locallang.xml [new file with mode: 0644]

index c8dc57a..bd89ef9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-09  Tobias Liebig  <mail_typo3@etobi.de>
+
+       * Fixed bug #11841: Hardcoded labels in t3editor (thanks to Christopher Stelmaszyk)
+
 2009-09-07  Steffen Kamper  <info@sk-typo3.de>
 
        * Follow-up to feature #11397: Added unit tests for t3lib_pageremder
index bc327c8..d821abc 100755 (executable)
@@ -44,6 +44,9 @@
  *
  * @author     Tobias Liebig <mail_typo3@etobi.de>
  */
+
+$GLOBALS['LANG']->includeLLFile('EXT:t3editor/locallang.xml');
+
 class tx_t3editor {
 
        /**
@@ -196,7 +199,7 @@ class tx_t3editor {
                                'id="t3editor_disableEditor_' . $this->editorCounter.'_checkbox" ' .
                                $checked.' />&nbsp;' .
                                '<label for="t3editor_disableEditor_' . $this->editorCounter . '_checkbox">' .
-                               'deactivate t3editor' .
+                               $GLOBALS['LANG']->getLL('deactivate') .
                                '</label>' .
                                '<br /><br />';
 
@@ -268,7 +271,10 @@ class tx_t3editor {
                                'wrap="off" ' .
                                $pObj->pObj->doc->formWidthText(48, 'width:98%;height:60%', 'off');
 
-                       $title = 'Template: ' . htmlspecialchars($parameters['tplRow']['title']) . ': Constants';
+                       $title = $GLOBALS['LANG']->getLL('template') . ' ' .
+                               htmlspecialchars($parameters['tplRow']['title']) .
+                               $GLOBALS['LANG']->getLL('delimiter') . ' ' .
+                               $GLOBALS['LANG']->getLL('constants');
 
                        $outCode = $GLOBALS['T3_VAR']['t3editorObj']->getCodeEditor(
                                                'data[constants]',
@@ -294,7 +300,10 @@ class tx_t3editor {
                                'wrap="off" ' .
                                $pObj->pObj->doc->formWidthText(48, 'width:98%;height:60%', 'off');
 
-                       $title = 'Template: ' . htmlspecialchars($parameters['tplRow']['title']) . ': Setup';
+                       $title = $GLOBALS['LANG']->getLL('template') . ' ' .
+                               htmlspecialchars($parameters['tplRow']['title']) .
+                               $GLOBALS['LANG']->getLL('delimiter') . ' ' .
+                               $GLOBALS['LANG']->getLL('setup');
 
                        $outCode = $GLOBALS['T3_VAR']['t3editorObj']->getCodeEditor(
                                                'data[config]',
@@ -343,7 +352,7 @@ class tx_t3editor {
                                // TODO: fileadmin, extmng, TCEform, ...
 
                                default:
-                                       $ajaxObj->setError('Unknown content type: ' . $codeType);
+                                       $ajaxObj->setError($GLOBALS['LANG']->getLL('unknownContentType') . ' ' . $codeType);
                        }
                        $ajaxObj->setContent(array('result' => $savingsuccess));
                }
index 6cb8812..eec9b65 100644 (file)
@@ -25,6 +25,8 @@
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 
+$GLOBALS['LANG']->includeLLFile('EXT:t3editor/locallang.xml');
+
 class tx_t3editor_codecompletion {
        /** @var TYPO3AJAX */
        protected $ajaxObj;
@@ -73,11 +75,11 @@ class tx_t3editor_codecompletion {
                                $templates = $this->getMergedTemplates($pageId);
                                // Otherwise, set an error:
                        } else {
-                               $this->ajaxObj->setError('Syntax error: Parameter pageId must be a valid integer.');
+                               $this->ajaxObj->setError($GLOBALS['LANG']->getLL('pageIDInteger'));
                        }
                        // Set an error if user has no access to sys_template records:
                } else {
-                       $this->ajaxObj->setError('Access denied: No permission to template records.');
+                       $this->ajaxObj->setError($GLOBALS['LANG']->getLL('noPermission'));
                }
 
                return $templates;
index 55daac5..686f15d 100644 (file)
@@ -33,6 +33,9 @@
  * @author Stephan Petzl <spetzl@gmx.at>
  * @author Christian Kartnig <office@hahnepeter.de>
  */
+
+$GLOBALS['LANG']->includeLLFile('EXT:t3editor/locallang.xml');
+
 class tx_t3editor_TSrefLoader {
        /** @var DOMDocument */
        protected $xmlDoc;
@@ -130,7 +133,7 @@ class tx_t3editor_TSrefLoader {
         */
        protected function getDescription($typeId, $parameterName = '') {
                if (!$typeId) {
-                       $this->ajaxObj->setError('Syntax error: At least parameter typeId has to be supplied.');
+                       $this->ajaxObj->setError($GLOBALS['LANG']->getLL('typeIDMissing'));
                        return '';
                }
 
diff --git a/typo3/sysext/t3editor/locallang.xml b/typo3/sysext/t3editor/locallang.xml
new file mode 100644 (file)
index 0000000..7da4689
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <description>Labels for t3editor</description>
+               <type>module</type>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="deactivate">Deactivate t3editor</label>
+                       <label index="template">Template</label>
+                       <label index="delimiter">:</label>
+                       <label index="constants">Constants</label>
+                       <label index="setup">Setup</label>
+                       <label index="unknownContentType">Unknown content type:</label>
+                       <label index="pageIDInteger">Syntax error: Parameter pageID must be a valid integer.</label>
+                       <label index="noPermission">Access denied: No permission to template records.</label>
+                       <label index="typeIDMissing">Syntax error: At least parameter typeID has to be supplied.</label>
+               </languageKey>
+       </data>
+</T3locallang>
\ No newline at end of file