[TYPO3-core] RFC #11378: Constant Editor uses hardcoded texts

Christopher Stelmaszyk christopher at yahoo.de
Mon Jun 22 21:30:59 CEST 2009


Hi!

This is a SVN patch request.

Type: feature

Branches: trunk

BT reference:
http://bugs.typo3.org/view.php?id=11378

Problem:
All texts in the constant editor are hardcoded.

Solution:
The attached patch makes the labels for the editor translatable.

Kind regards

Christopher




Index: typo3/sysext/tstemplate_ceditor/locallang.xml
===================================================================
--- typo3/sysext/tstemplate_ceditor/locallang.xml	(revision 0)
+++ typo3/sysext/tstemplate_ceditor/locallang.xml	(revision 0)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+	<meta type="array">
+		<description>Labels for the constant editor</description>
+		<type>module</type>
+	</meta>
+	<data type="array">
+		<languageKey index="default" type="array">
+			<label index="editConstants">Edit constants for template:</label>
+			<label index="category">Category:</label>
+			<label index="noConstants">No constants available</label>
+			<label index="noConstantsLong">There are no editable constants available 
for the Constant Editor.</label>
+		</languageKey>
+	</data>
+</T3locallang>
\ No newline at end of file
Index: typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php
===================================================================
--- typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php	(revision 
5606)
+++ typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php	(working 
copy)
@@ -30,11 +30,13 @@
  * Module Include-file
  *
  * localconf-variables:
- * $TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"] = 
"fileadmin/fonts/";		// This is the path (must be in "fileadmin/" !!) where 
the web_ts/constant-editor submodule fetches online resources. Put fonts 
(ttf) and standard images here!
+ * $TYPO3_CONF_VARS['MODS']['web_ts']['onlineResourceDir'] = 
'fileadmin/fonts/';		// This is the path (must be in "fileadmin/" !!) where 
the web_ts/constant-editor submodule fetches online resources. Put fonts 
(ttf) and standard images here!
  *
  * @author	Kasper Skårhøj <kasperYYYY at typo3.com>
  */

+$GLOBALS['LANG']->includeLLFile('EXT:tstemplate_ceditor/locallang.xml');
+
 class tx_tstemplateceditor extends t3lib_extobjbase {
 	function initialize_editor($pageId,$template_uid=0)	{
 			// Initializes the module. Done in this function because we may need to 
re-initialize if data is submitted!
@@ -144,7 +146,7 @@
 				// Resetting the menu (stop)

 			$theOutput.=$this->pObj->doc->spacer(5);
-			$theOutput.=$this->pObj->doc->section("Edit constants for 
template:",'<img '.t3lib_iconWorks::skinImg($BACK_PATH, 
t3lib_iconWorks::getIcon('sys_template', $tplRow)).' align="top" /> 
<b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"],"constants").'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' 
 - ('.$tplRow["sitetitle"].')':''),0,1);
+ 
$theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('editConstants', 
true),'<img '.t3lib_iconWorks::skinImg($BACK_PATH, 
t3lib_iconWorks::getIcon('sys_template', $tplRow)).' align="top" /> 
<b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"],"constants").'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' 
 - ('.$tplRow["sitetitle"].')':''),0,1);

 			if ($manyTemplatesMenu)	{
 				$theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
@@ -153,10 +155,10 @@

 			$theOutput.=$this->pObj->doc->spacer(5);
 			if (count($this->pObj->MOD_MENU["constant_editor_cat"]))	{
-				$menu = "Category: 
".t3lib_BEfunc::getFuncMenu($this->pObj->id,"SET[constant_editor_cat]",$this->pObj->MOD_SETTINGS["constant_editor_cat"],$this->pObj->MOD_MENU["constant_editor_cat"]);
+				$menu = $GLOBALS['LANG']->getLL('category', true)." 
".t3lib_BEfunc::getFuncMenu($this->pObj->id,"SET[constant_editor_cat]",$this->pObj->MOD_SETTINGS["constant_editor_cat"],$this->pObj->MOD_MENU["constant_editor_cat"]);
 				$theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
 			} else {
-				$theOutput.=$this->pObj->doc->section("No constants available","There 
are no editable constants available for the Constant Editor.",1,0,1);
+ 
$theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('noConstants', 
true),$GLOBALS['LANG']->getLL('noConstantsLong', true),1,0,1);
 			}

 


begin 666 11378.patch
M26YD97 at Z('1Y<&\S+W-Y<V5X="]T<W1E;7!L871E7V-E9&ET;W(O;&]C86QL
M86YG+GAM; T*/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/0T*+2TM('1Y<&\S+W-Y
M<V5X="]T<W1E;7!L871E7V-E9&ET;W(O;&]C86QL86YG+GAM; DH<F5V:7-I
M;VX@,"D-"BLK*R!T>7!O,R]S>7-E>'0O='-T96UP;&%T95]C961I=&]R+VQO
M8V%L;&%N9RYX;6P)*')E=FES:6]N(# I#0I 0" M,"PP("LQ+#$U($! #0HK
M/#]X;6P@=F5R<VEO;CTB,2XP(B!E;F-O9&EN9STB=71F+3 at B('-T86YD86QO
M;F4](GEE<R(@/SX-"BL\5#-L;V-A;&QA;F<^#0HK"3QM971A('1Y<&4](F%R
M<F%Y(CX-"BL)"3QD97-C<FEP=&EO;CY,86)E;', at 9F]R('1H92!C;VYS=&%N
M="!E9&ET;W(\+V1E<V-R:7!T:6]N/@T**PD)/'1Y<&4^;6]D=6QE/"]T>7!E
M/@T**PD\+VUE=&$^#0HK"3QD871A('1Y<&4](F%R<F%Y(CX-"BL)"3QL86YG
M=6%G94ME>2!I;F1E>#TB9&5F875L="(@='EP93TB87)R87DB/@T**PD)"3QL
M86)E;"!I;F1E>#TB961I=$-O;G-T86YT<R(^161I="!C;VYS=&%N=', at 9F]R
M('1E;7!L871E.CPO;&%B96P^#0HK"0D)/&QA8F5L(&EN9&5X/2)C871E9V]R
M>2(^0V%T96=O<GDZ/"]L86)E;#X-"BL)"0D\;&%B96P@:6YD97@](FYO0V]N
M<W1A;G1S(CY.;R!C;VYS=&%N=', at 879A:6QA8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F]N=',@*'1T9BD at 86YD('-T86YD87)D(&EM86=E<R!H97)E(0HK("H@
M)%194$\S7T-/3D9?5D%24ULG34]$4R==6R=W96)?=',G75LG;VYL:6YE4F5S
M;W5R8V5$:7(G72 ]("=F:6QE861M:6XO9F]N=',O)SL)"2\O(%1H:7,@:7,@
M=&AE('!A=&@@*&UU<W0 at 8F4@:6X@(F9I;&5A9&UI;B\B("$A*2!W:&5R92!T
M:&4@=V5B7W1S+V-O;G-T86YT+65D:71O<B!S=6)M;V1U;&4 at 9F5T8VAE<R!O
M;FQI;F4@<F5S;W5R8V5S+B!0=70 at 9F]N=',@*'1T9BD at 86YD('-T86YD87)D
M(&EM86=E<R!H97)E(0H@("H*(" J($!A=71H;W()2V%S<&5R(%-KY7)H^&H@
M/&MA<W!E<EE965E ='EP;S,N8V]M/@H@("HO"B **R1'3$]"04Q36R=,04Y'
M)UTM/FEN8VQU9&5,3$9I;&4H)T585#IT<W1E;7!L871E7V-E9&ET;W(O;&]C
M86QL86YG+GAM;"<I.PHK"B!C;&%S<R!T>%]T<W1E;7!L871E8V5D:71O<B!E
M>'1E;F1S('0S;&EB7V5X=&]B:F)A<V4@>PH@"69U;F-T:6]N(&EN:71I86QI
M>F5?961I=&]R*"1P86=E260L)'1E;7!L871E7W5I9#TP*0E["B )"0DO+R!)
M;FET:6%L:7IE<R!T:&4@;6]D=6QE+B!$;VYE(&EN('1H:7, at 9G5N8W1I;VX@
M8F5C875S92!W92!M87D@;F5E9"!T;R!R92UI;FET:6%L:7IE(&EF(&1A=&$@
M:7,@<W5B;6ET=&5D(0I 0" M,30T+#<@*S$T-BPW($! #0H@"0D)"2\O(%)E
M<V5T=&EN9R!T:&4@;65N=2 H<W1O<"D*( H@"0D))'1H94]U='!U="X])'1H
M:7,M/G!/8FHM/F1O8RT^<W!A8V5R*#4I.PHM"0D))'1H94]U='!U="X])'1H
M:7,M/G!/8FHM/F1O8RT^<V5C=&EO;B at B161I="!C;VYS=&%N=', at 9F]R('1E
M;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+3YG971,3"@G;F]#;VYS=&%N=',G+"!T<G5E*2PD1TQ/
M0D%,4ULG3$%.1R==+3YG971,3"@G;F]#;VYS=&%N='-,;VYG)RP@=')U92DL
2,2PP+#$I.PH@"0D)?0H@"B *
`
end



More information about the TYPO3-team-core mailing list