1
votes

I have set up an .xlf localisation file in a TYPO3 6.2 extbase extension under Resources/Private/Language, named fr.locallang.xlf.

It looks like this

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<xliff version="1.0">
  <file source-language="de" datatype="plaintext" original="messages" date="2014-11-05T12:20:37Z" product-name="extname" target-language="fr">
    <header/>
    <body>
      <trans-unit id="tx_extname_domain_model_item">
        <source>German Term</source>
        <target>French Term</target>
      </trans-unit>
    </body>
  </file>
</xliff>

Typoscript:

[globalVar = GP:L = 1]
config {
    sys_language_uid = 1
    language = fr
    htmlTag_langKey = fr
    locale_all = fr_FR.utf-8
}
[global]

Translations aren't showing in the frontend. What do I have to do to make them show? Or is there a workaround, like getting back to xml in extbase? Else, I'll have to use constants and pass them in as Variables...

1

1 Answers

2
votes

I think, there has to be a locallang.xlf with just the default localization as <source> in the same directory.

And I assume you are using the translate ViewHelper from fluid?

<f:translate key="tx_extname_domain_model_item" />

If the view belongs to another extension than your locallang file, you also have to add a extension name to the ViewHelper:

<f:translate key="tx_extname_domain_model_item" extensionName="extname" />

And last but not least, the whole localization is fully cached, so make sure to clear the system cache in order to see any changes made to XLF or XML localization files.

To enable the system cache option in production add options.clearCache.system = 1 to your UserTSConfig.