[TYPO3-project-formidable] Use customtags to translate messages

Manuel Rego Casasnovas mrego at igalia.com
Tue Jun 12 09:16:42 CEST 2007


Hello everyone.

Sometimes I need to put in my templates messages, but I need that this
messages are translated in the frontend user language. For now I use a
custom tag to do this the next way:
<customtags>
    <tag_next>
        <name>next</name>
        <value>
            <userobj>
                <php>
                    <![CDATA[
                        return
$this->_oParent->pi_getLL('tx_myext_pi1.next');
                    ]]>
                </php>
            </userobj>
        </value>
    </tag_next>
</customtags>

And in my template I can use '{next}' to get the message translated.


I thank that can be a good option use the next XML config:
<customtags>
   <tag_next>
      <name>next</name>
      <value>LLL:EXT:my_ext/pi1/locallang.xml:tx_myext_pi1.next</value>
   </tag_next>
</customtags>

To get this I've modified the line 3010 for the next code:
$value = $this->_getLLLabel($aTag["value"]);

With this little modification I can simplify a lot my XML config files.

I don't know if this is a good option to add to the next FORMidable release.

Bye,
   Rego

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com


More information about the TYPO3-project-formidable mailing list