[TYPO3-core] RFC #8510: Hardcoded labels in typo3/show_item.php
Christopher Stelmaszyk
Christopher at temporaryforwarding.com
Mon Jul 14 02:10:14 CEST 2008
Hi Masi,
concerning $LANG I see no problem.
For me this works.
But you did not apply the patch completely:
The file locallang_core is modified correctly.
But you forgot some parts in typo3/show_item.php.
Attached are these parts you forgot.
Again against current trunk.
Commit them and they will fit.
Then this issue is finally resolved.
Christopher
"Martin Kutschker" schrieb im Newsbeitrag
news:mailman.1.1215960841.27346.typo3-team-core at lists.netfielders.de...
> Christopher schrieb:
>> Hi,
>>
>> this is a SVN patch request.
>>
>> Type: Bugfix
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=8510
>>
>> Branches:
>> TYPO3_4-1, TYPO3_4-2 and trunk.
>>
>> Problem:
>> In typo3/show_item.php are still quiet a number of texts which are
>> hardcoded.
>>
>>
>> Solution:
>> I made them translateable with llxml-translate. :-)
>
> Committed to trunk (rev. 3886). Attached is the committed change.
>
> BUT (!) the patch didn't apply cleanly so I had to fiddle around. While
> doinjg so I changed all "local $LANG; $LANG" occurences to
> "$GLOBALS['LANG']" (required by CGL).
>
> Please check ASAP if this still works for you as expected!
>
> Masi
>
--------------------------------------------------------------------------------
> Index: typo3/show_item.php
> ===================================================================
> --- typo3/show_item.php (revision 3872)
> +++ typo3/show_item.php (working copy)
> @@ -158,7 +158,7 @@
> * @return void
> */
> function init() {
> - global $BE_USER,$LANG,$BACK_PATH,$TCA;
> + global $BE_USER,$BACK_PATH,$TCA;
>
> // Setting input variables.
> $this->table = t3lib_div::_GET('table');
> @@ -212,8 +212,8 @@
> $this->doc->docType = 'xhtml_trans';
>
> // Starting the page by creating page header stuff:
> -
> $this->content.=$this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:show_item.php.viewItem'));
> -
> $this->content.=$this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:show_item.php.viewItem'));
> +
> $this->content.=$this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.viewItem'));
> +
> $this->content.=$this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.viewItem'));
> $this->content.=$this->doc->spacer(5);
> }
>
> @@ -223,7 +223,6 @@
> * @return void
> */
> function main() {
> - global $LANG;
>
> if ($this->access) {
> $returnLinkTag = t3lib_div::_GP('returnUrl') ? '<a
> href="'.t3lib_div::_GP('returnUrl').'" class="typo3-goBack">' : '<a
> href="#" onclick="window.close();">';
> @@ -258,9 +257,9 @@
>
> // If return Url is set, output link to go back:
> if (t3lib_div::_GP('returnUrl')) {
> - $this->content =
> $this->doc->section('',$returnLinkTag.'<strong>'.$LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.goBack',1).'</strong></a><br
> /><br />').$this->content;
> + $this->content =
> $this->doc->section('',$returnLinkTag.'<strong>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.goBack',1).'</strong></a><br
> /><br />').$this->content;
>
> - $this->content .= $this->doc->section('','<br
> />'.$returnLinkTag.'<strong>'.$LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.goBack',1).'</strong></a>');
> + $this->content .= $this->doc->section('','<br
> />'.$returnLinkTag.'<strong>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.goBack',1).'</strong></a>');
> }
> }
> }
> @@ -271,7 +270,7 @@
> * @return void
> */
> function renderDBInfo() {
> - global $LANG,$TCA;
> + global $TCA;
>
> // Print header, path etc:
> $code =
> $this->doc->getHeader($this->table,$this->row,$this->pageinfo['_thePath'],1).'<br
> />';
> @@ -290,7 +289,7 @@
> $i++;
> $tableRows[] = '
> <tr>
> - <td
> class="bgColor5">'.$LANG->sL(t3lib_BEfunc::getItemLabel($this->table,$name),1).'</td>
> + <td
> class="bgColor5">'.$GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel($this->table,$name),1).'</td>
> <td
> class="bgColor4">'.htmlspecialchars(t3lib_BEfunc::getProcessedValue($this->table,$name,$this->row[$name])).'</td>
> </tr>';
> }
> @@ -307,8 +306,8 @@
>
> // Add path and table information in the bottom:
> $code = '';
> - $code.= $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').':
> '.t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-48).'<br />';
> - $code.= $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.table').':
> '.$LANG->sL($TCA[$this->table]['ctrl']['title']).' ('.$this->table.') -
> UID: '.$this->uid.'<br />';
> + $code.=
> $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path').':
> '.t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-48).'<br />';
> + $code.=
> $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.table').':
> '.$GLOBALS['LANG']->sL($TCA[$this->table]['ctrl']['title']).'
> ('.$this->table.') - UID: '.$this->uid.'<br />';
> $this->content.= $this->doc->section('', $code);
>
> // References:
> @@ -325,7 +324,6 @@
> * @return void
> */
> function renderFileInfo($returnLinkTag) {
> - global $LANG;
>
> // Initialize object to work on the image:
> require_once(PATH_t3lib.'class.t3lib_stdgraphic.php');
> @@ -347,16 +345,16 @@
> // Setting header:
> $icon = t3lib_BEfunc::getFileIcon($ext);
> $url = 'gfx/fileicons/'.$icon;
> - $fileName = '<img src="'.$url.'" width="18" height="16" align="top"
> alt=""
> /><b>'.$LANG->sL('LLL:EXT:lang/locallang_core.php:show_item.php.file',1).':</b>
> '.$fI['file'];
> + $fileName = '<img src="'.$url.'" width="18" height="16" align="top"
> alt=""
> /><strong>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.file',
> 1).':</strong> '.$fI['file'];
> if (t3lib_div::isFirstPartOfStr($this->file,PATH_site)) {
> $code.= '<a href="../'.substr($this->file,strlen(PATH_site)).'"
> target="_blank">'.$fileName.'</a>';
> } else {
> $code.= $fileName;
> }
> - $code.='
> <b>'.$LANG->sL('LLL:EXT:lang/locallang_core.php:show_item.php.filesize').':</b>
> '.t3lib_div::formatSize(@filesize($this->file)).'<br />
> + $code.='
> <strong>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.filesize').':</strong>
> '.t3lib_div::formatSize(@filesize($this->file)).'<br />
> ';
> if (is_array($imgInfo)) {
> - $code.=
> '<b>'.$LANG->sL('LLL:EXT:lang/locallang_core.php:show_item.php.dimensions').':</b>
> '.$imgInfo[0].'x'.$imgInfo[1].' pixels';
> + $code.=
> '<strong>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.dimensions').':</strong>
> '.$imgInfo[0].'x'.$imgInfo[1].'
> '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.pixels');
> }
> $this->content.=$this->doc->section('',$code);
> $this->content.=$this->doc->divider(2);
> @@ -412,7 +410,7 @@
>
> $code.='
> -------<br/>
> - '.count($t).' files';
> + '.count($t).'
> '.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.files');
>
> $code = '
> <span class="nobr">'.$code.'
> @@ -494,12 +492,12 @@
> $infoData = array();
> if (count($rows)) {
> $infoData[] = '<tr class="bgColor5 tableheader">' .
> - '<td>Table:</td>' .
> - '<td>Uid:</td>' .
> - '<td>Field:</td>'.
> - '<td>Flexpointer:</td>'.
> - '<td>Softref Key:</td>'.
> - '<td>Sorting:</td>'.
> +
> '<td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.table').'</td>'
> .
> +
> '<td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.uid').'</td>'
> .
> +
> '<td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.field').'</td>'.
> +
> '<td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.flexpointer').'</td>'.
> +
> '<td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.softrefKey').'</td>'.
> +
> '<td>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.sorting').'</td>'.
> '</tr>';
> }
> foreach($rows as $row) {
> Index: typo3/sysext/lang/locallang_core.xml
> ===================================================================
> --- typo3/sysext/lang/locallang_core.xml (revision 3872)
> +++ typo3/sysext/lang/locallang_core.xml (working copy)
> @@ -98,9 +98,23 @@
> <label index="ver.swapPage">Publish this version of the page including
> content</label>
> <label index="TYPO3_Element_Browser">TYPO3 Element Browser</label>
> <label index="show_item.php.viewItem">View Item</label>
> + <label index="show_item.php.referencesToThisItem">References to this
> item:</label>
> + <label index="show_item.php.referencesFromThisItem">References from this
> item:</label>
> <label index="show_item.php.file">File</label>
> <label index="show_item.php.dimensions">Dimensions</label>
> <label index="show_item.php.filesize">Size</label>
> + <label index="show_item.php.pixels">Pixels</label>
> + <label index="show_item.php.files">files</label>
> + <label index="show_item.php.cannotDisplayArchive">Sorry,
> TYPO3_CONF_VARS[BE][disable_exec_function] was set, so cannot display
> content of archive file.</label>
> + <label index="show_item.php.table">Table:</label>
> + <label index="show_item.php.uid">Uid:</label>
> + <label index="show_item.php.field">Field:</label>
> + <label index="show_item.php.flexpointer">Flexpointer:</label>
> + <label index="show_item.php.softrefKey">Softref Key:</label>
> + <label index="show_item.php.sorting">Sorting:</label>
> + <label index="show_item.php.refTable">Ref Table:</label>
> + <label index="show_item.php.refUid">Ref Uid:</label>
> + <label index="show_item.php.refString">Ref String:</label>
> <label index="show_item.php.ftp_area">FTP AREA</label>
> <label index="db_new.php.pagetitle">New record</label>
> <label index="db_new.php.after">after</label>
>
begin 666 8510_forgotten_parts.diff
M+2TM('1Y<&\S+W-H;W=?:71E;2YP:' ),C P."TP-RTQ-" P,3HR-CHU.2XP
M,# P,# P,# @*S R,# -"BLK*R!T>7!O,R]S:&]W7VET96TN<&AP"3(P,#@M
M,#<M,30@,#$Z-38Z-30N,# P,# P,# P("LP,C P#0I 0"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