identifier Locales define the language and formats to use Locales form a hierarchy • en is a parent of en_US which is a parent of en_US_POSIX • Thus items for the en_US locale that do not exist, will be used from the en locale if available
will use most <f:translate id="my.label.1"/> {f:translate(id: 'my.label.1')} translation by label is possible, but discouraged • less reliable than id-based translation • prohibits changes to the original label
hold translations for one locale It contains one or more <file> elements corresponding to a source Localizable data is stored in <trans-unit> elements which contain a <source> element to store the source text and a (non-mandatory) <target> element to store the translated text
<trans-unit id="my.label.3" xml:space="preserve"> <source>I have {0} and {1}</source> <target>{1} habe ich und {0} habe ich auch</target> </trans-unit> <f:translate id="my.label.3" arguments="{0: foo, 1: bar}"/>
<trans-unit id="my.label.3" xml:space="preserve"> <source>I have {some} and {thing}</source> <target>{thing} habe ich und {some} habe ich auch</target> </trans-unit> <f:translate id="my.label.3" arguments="{'some': foo, 'thing': bar}"/> * will be available with Flow 2.0
plural forms • zero, one, two, few, many, other Different languages use more or less forms • singular and plurals for English • one, few and other for Polish • only other for Japanese
<source>There is this quark</source> </trans-unit> <trans-unit id="my.label.6[1]" xml:space="preserve"> <source>There are these quarks</source> </trans-unit> </group> Plural forms <f:translate id="my.label.6" quantity="{quarks->f:count()}"/>
@return void */ public function selectAction($locale = NULL) { if ($locale !== NULL) { $this->i18nService->getConfiguration()->setCurrentLocale( new \TYPO3\Flow\I18n\Locale($locale) ); } $this->forward('index'); } Setting current locale WARNING: Stupid example
VH pending in review Fallback per label is missing, currently only done per catalog Overriding parts of catalogs is missing Model translation still missing
found at: http://speakerdeck.com/kdambekalns http://slideshare.net/kfish Give me feedback: [email protected] | [email protected] Download Flow: http://flow.typo3.org Follow me on twitter: @kdambekalns Support me using