Typo3: Create translations of Extension Builder elements

175 views Asked by At

I used extension builder to set up my frist extension. Except for the translation and everything works very well.

You can bind an element to an language but not the other way round. What I would like to do is, to create all needed elements in the default language and then create translations based on (some) of these elements, like you do in Typo3 Web-View. It's important that there is some kind of connection/relation between the defaulr element and its translations to make a fallback to the default language possible.

Is this possible? Or do I need to create multiple fields for all element properties (for all langs expected so far) in each element?

Update/Solution

It seems as if the desired function is already implemented (just a bit hidden).

First you need to create a new Element in default language. Next you create a second new Element and save it as the desired language in which you need to extend the first Element. If you reopen the second one a new select field shows up, where you can choose the lang-parent. Save it again an you'll have the connection.

1

There are 1 answers

3
nbar On

Do we talk about Fluid extensions?

If so you have a translation tool:

<f:translate key="list_nonewsfound" />

And to translate this u have to create a file in /Resources/Private/Language/locallang.xml

<T3locallang>
    <meta type="array">
        <type>database</type>
        <description>Language labels for database tables/fields belonging to extension 'news'</description>
    </meta>
    <data type="array">
        <languageKey index="default" type="array">
            <label index="list_nonewsfound">No news available.</label>
        </languageKey>
        <languageKey index="da" type="array">
            <label index="list_nonewsfound">Ingen tilgængelige nyheder.</label>
        </languageKey>
    </data>
</T3locallang>
  • (Example taken from tx_news)

More information (german link): http://docs.typo3.org/typo3cms/ExtbaseGuide/Fluid/ViewHelper/Translate.html

(english link): http://wiki.typo3.org/Fluid#f:translate