TYPO3/Overwrite translations

Since version 0.7 of the TYPO3 extension, there is the possibility to overwrite translations from the core or other Arcavias extensions via TypoScript. This is very comfortable if you only want to replace certain existing translations by your own one. For each translation, you need the ISO language code, the translation domain, the original string and the new translation, e.g.

plugin.tx_arcavias.settings.i18n.. {  domain = string = trans = }

Note: This should be used if you only want to replace a few translations. If you translate to a complete new language, please use the Transifex website to create a new translation that can be added to the Arcavias core. Also, if you already created your own Arcavias extension, you could overwrite translations from the core by providing a new .po file that only contains the new translations. The performance in both cases is much better than defining a huge amount of translations via TypoScript.

Required information

 * ISO language code : To specify the language for the translation, the two letter ISO language codes (639-1) are necessary. It's also possible to add the two letter ISO country codes to refer to country specific language variants like "en_GB" for British English. You can use all languages that are mapped via TypoScript from the TYPO3 language IDs, e.g. L=0 is the default language in TYPO3 and can be mapped with config.language=en to English. Please make sure the language code is always in lower case while the the optional country code is always in upper case.


 * number : This is a continuous number to distinguish between the different translations added to the TypoScript configuration. If you are using a number twice, the later translation definition will overwrite the former one.


 * domain : The translation domain where the original string is from. The Arcavias core has five translation domains: mshop (core lib with managers), controller/frontend (basic business logic for the frontend), client/html (frontend HTML parts), controller/extjs (server side processing of request from the administration interface) and client/extjs (default administration interface). To find out the domain a string is from, you have to look at the .pot files in the Arcavias core for the string.


 * string : It's the original singular string from the source code or the .pot file. The string must be exactly the same (character case, white spaces, etc.) as in the source code / .pot file.


 * trans : New translation for the original string. This can be also an array if one or more plural forms are necessary.

Singular translations
A simple singular translation to English:

plugin.tx_arcavias.settings.i18n.en.0 { domain = client/html string = address trans = Addresses }

A simple singular translation to US English:

plugin.tx_arcavias.settings.i18n.en_US.0 { domain = client/html string = basket trans = Shopping cart }

Several singular translations to English:

plugin.tx_arcavias.settings.i18n.en { 0 {    domain = client/html string = basket trans = Basket }  1 {     domain = client/html string = address trans = Address } }

Plural translation to English:

plugin.tx_arcavias.settings.i18n.en.0 { domain = client/html string = address trans { 0 = Address 1 = Addresses } }

Plural translations
A translations including one or more plural forms can be defined if the original string in the source code also supports plurals. In this case the source code looks like

( ' ', ', ' ', );

and the translation methods for plurals can be translate or dn. To overwrite a plural translation, the simplest form is:

plugin.tx_arcavias.settings.i18n.. {  domain = string = trans { 0 =     =  }

The index "0" is always the singular translation. Most languages only have one plural form, so it must be defined by using the index "1". But some languages use several plural forms depending on the count given in the last parameter of the translation method. In this case, the index depends on the language and the value of. To find out the right index for the language, you have to have a look into the _getPluralIndex method that maps to the index for the language you want to translate. An example for Czech would be:

plugin.tx_arcavias.settings.i18n.cz.0 { domain = client/html string = hour trans { 0 = dlouhá hodina # one hour 1 = dlouhé hodiny # two to four hours 2 = dlouhých hodin # more than four hours } }