Fixed bug #11372: Template-Analyzer uses hardcoded texts - added localization (thanks...
authorSteffen Kamper <info@sk-typo3.de>
Sun, 21 Jun 2009 21:20:04 +0000 (21:20 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sun, 21 Jun 2009 21:20:04 +0000 (21:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5606 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php
typo3/sysext/tstemplate_analyzer/locallang.xml [new file with mode: 0644]

index a0339e3..87c36ed 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-12  Steffen Kamper  <info@sk-typo3.de>
+
+       * Fixed bug #11372: Template-Analyzer uses hardcoded texts - added localization (thanks to Christopher Stelmaszyk)
+
 2009-06-21  Benjamin Mack  <benni@typo3.org>
 
        * Fixed #11356: Backend Login News is not templateable
index 787c895..0163983 100644 (file)
@@ -28,6 +28,8 @@
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  */
 
+$GLOBALS['LANG']->includeLLFile('EXT:tstemplate_analyzer/locallang.xml');
+
 class tx_tstemplateanalyzer extends t3lib_extobjbase {
        function init(&$pObj,$conf)     {
                parent::init($pObj,$conf);
@@ -89,7 +91,10 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid);               // initialize
                if ($existTemplate)     {
                        $theOutput.=$this->pObj->doc->divider(5);
-                       $theOutput.=$this->pObj->doc->section("Current template:",'<img '.t3lib_iconWorks::skinImg($BACK_PATH, t3lib_iconWorks::getIcon('sys_template', $tplRow)).' align="top" /> <b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"]).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''));
+                       $theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('currentTemplate', true) ,
+                               '<img '.t3lib_iconWorks::skinImg($BACK_PATH, t3lib_iconWorks::getIcon('sys_template', $tplRow)) . ' align="top" /> <b>' .
+                               $this->pObj->linkWrapTemplateTitle($tplRow["title"]) . '</b>' .
+                               htmlspecialchars(trim($tplRow["sitetitle"]) ? ' - (' . $tplRow["sitetitle"] . ')' : ''));
                }
                if ($manyTemplatesMenu) {
                        $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
@@ -106,46 +111,46 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
 
                $hierarArr = array();
                $head = '<tr class="c-headLineTable">';
-               $head.= '<td>Title</td>';
-               $head.= '<td>Rootlevel</td>';
-               $head.= '<td>Clear Setup</td>';
-               $head.= '<td>Clear Constants</td>';
-               $head.= '<td>PID</td>';
-               $head.= '<td>Rootline</td>';
-               $head.= '<td>Next Level</td>';
+               $head.= '<td>' . $GLOBALS['LANG']->getLL('title', true) . '</td>';
+               $head.= '<td>' . $GLOBALS['LANG']->getLL('rootlevel', true) . '</td>';
+               $head.= '<td>' . $GLOBALS['LANG']->getLL('clearSetup', true) . '</td>';
+               $head.= '<td>' . $GLOBALS['LANG']->getLL('clearConstants', true) . '</td>';
+               $head.= '<td>' . $GLOBALS['LANG']->getLL('pid', true) . '</td>';
+               $head.= '<td>' . $GLOBALS['LANG']->getLL('rootline', true) . '</td>';
+               $head.= '<td>' . $GLOBALS['LANG']->getLL('nextLevel', true) . '</td>';
                $head.= '</tr>';
                $hierar = implode(array_reverse($tmpl->ext_getTemplateHierarchyArr($tmpl->hierarchyInfoArr, "", array(), 1)), "");
-               $hierar= '<table id="ts-analyzer" border="0"" cellpadding="0"" cellspacing="1">' . $head . $hierar . '</table>';
+               $hierar= '<table id="ts-analyzer" border="0" cellpadding="0" cellspacing="1">' . $head . $hierar . '</table>';
 
                $theOutput.=$this->pObj->doc->spacer(5);
-               $theOutput.=$this->pObj->doc->section("Template hierarchy:", $hierar, 0, 1);
+               $theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('templateHierarchy', true), $hierar, 0, 1);
 
 
                        // Output options
                $theOutput.=$this->pObj->doc->spacer(25);
                $theOutput.=$this->pObj->doc->divider(0);
-               $theOutput.=$this->pObj->doc->section("Display Options", '', 1, 1);
+               $theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions', true), '', 1, 1);
                $addParams = t3lib_div::_GET('template') ? '&template=' . t3lib_div::_GET('template') : '';
                $theOutput .= '<div class="tst-analyzer-options">' .
                        t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkLinenum]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkLinenum"], '', $addParams, 'id="checkTs_analyzer_checkLinenum"') .
-                       '<label for="checkTs_analyzer_checkLinenum">Line numbers</label> ' .
+                       '<label for="checkTs_analyzer_checkLinenum">' . $GLOBALS['LANG']->getLL('lineNumbers', true) . '</label> ' .
                        t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkSyntax]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"], '', $addParams, 'id="checkTs_analyzer_checkSyntax"') .
-                       '<label for="checkTs_analyzer_checkSyntax">Syntax highlight</label> ' .
+                       '<label for="checkTs_analyzer_checkSyntax">' . $GLOBALS['LANG']->getLL('syntaxHighlight', true) . '</label> ' .
                        (!$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"] ?
                                t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkComments]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkComments"], '', $addParams, 'id="checkTs_analyzer_checkComments"') .
-                               '<label for="checkTs_analyzer_checkComments">Comments</label> ' .
+                               '<label for="checkTs_analyzer_checkComments">' . $GLOBALS['LANG']->getLL('comments', true) . '</label> ' .
                                t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkCrop]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkCrop"], '', $addParams, 'id="checkTs_analyzer_checkCrop"') .
-                               '<label for="checkTs_analyzer_checkCrop">Crop lines</label> '
+                               '<label for="checkTs_analyzer_checkCrop">' . $GLOBALS['LANG']->getLL('cropLines', true) . '</label> '
                                :
                                t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkSyntaxBlockmode]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"], '', $addParams, 'id="checkTs_analyzer_checkSyntaxBlockmode"') .
-                               '<label for="checkTs_analyzer_checkSyntaxBlockmode">Block mode</label> '
+                               '<label for="checkTs_analyzer_checkSyntaxBlockmode">' . $GLOBALS['LANG']->getLL('blockMode', true) . '</label> '
                        ) . '</div>';
 
 
 
                                // Output Constants
                        if (t3lib_div::_GET('template')) {
-                               $theOutput .= $this->pObj->doc->section("Constants:", "", 0, 1);
+                               $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants', true), "", 0, 1);
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
                                        <table border=0 cellpadding=1 cellspacing=0>
@@ -184,7 +189,7 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                        // Output setup
                        if (t3lib_div::_GET('template')) {
                                $theOutput .= $this->pObj->doc->spacer(15);
-                               $theOutput .= $this->pObj->doc->section("SETUP:", "", 0, 1);
+                               $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup', true), "", 0, 1);
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
                                        <table border=0 cellpadding=1 cellspacing=0>
diff --git a/typo3/sysext/tstemplate_analyzer/locallang.xml b/typo3/sysext/tstemplate_analyzer/locallang.xml
new file mode 100644 (file)
index 0000000..4b6f857
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
+<T3locallang>\r
+       <meta type="array">\r
+               <description>Labels for the template-analyzer</description>\r
+               <type>module</type>\r
+       </meta>\r
+       <data type="array">\r
+               <languageKey index="default" type="array">\r
+                       <label index="currentTemplate">Current template:</label>\r
+                       <label index="title">Title</label>\r
+                       <label index="rootlevel">Rootlevel</label>\r
+                       <label index="clearSetup">Clear Setup</label>\r
+                       <label index="clearConstants">Clear Constants</label>\r
+                       <label index="pid">PID</label>\r
+                       <label index="rootline">Rootline</label>\r
+                       <label index="nextLevel">Next Level</label>\r
+                       <label index="templateHierarchy">Template hierarchy:</label>\r
+                       <label index="displayOptions">Display Options</label>\r
+                       <label index="lineNumbers">Line numbers</label>\r
+                       <label index="syntaxHighlight">Syntax highlight</label>\r
+                       <label index="comments">Comments</label>\r
+                       <label index="cropLines">Crop lines</label>\r
+                       <label index="blockMode">Block mode</label>\r
+                       <label index="constants">Constants:</label>\r
+                       <label index="setup">Setup:</label>\r
+               </languageKey>\r
+       </data>\r
+</T3locallang>
\ No newline at end of file