3.1.3 Language file explanation
You should work in English first, you can always change the default language later using TYPO3's language configuration. Doing this makes it much easier to share your examples, get support, avoid confusion with label names and of course it makes your work suitable for use with translation software like Pootle (see fx http://translation.typo3.org). Remember: English is the official language of TYPO3. You can find the official TYPO3 internationalisation documentaion at http://docs.typo3.org/TYPO3/CoreApiReference/Internationalization/Introduction/Index.html and should make yourself familiar with it.
Your extension's locallang.xlf
file needs to be in the folder typo3conf/ext/**YOUREXT**/Resources/Private/Language/
. For
other languages simply create a new file with the ISO code in front of the filename, for example de.locallang.xlf
for German.
For a list of ISO language codes you can visit http://www.loc.gov/standards/iso639-2/php/code_list.php
All Languagefiles should at least contain the following:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages"
date="2012-10-17T17:55:17Z" product-name="**YOUREXT**">
<header/>
<body>
</body>
</file>
</xliff>
If you want to use labels or descriptions in the frontend output, you should also place them in the locallang.xlf
of the
target language. To display the label contactperson
you can add this to your Template, Layout or Partial file:
<f:translate key="contactperson" extensionName="YOUREXT"/>
As an alternative you can use this tag inline like this:
{f:translate(key: 'contactperson', extensionName: 'YOUREXT')}
In the locallang.xlf
place this within the body-tag:
<trans-unit id="contactperson">
<source>Contactperson</source>
</trans-unit>
Again, to use it in a different language, place this in your iso.locallang.xlf
(in this example in de.locallang.xlf
):
<trans-unit id="contactperson">
<target>Ansprechpartner</target>
</trans-unit>