Wednesday 28 January 2004 6:57:17 am
OK; I have some text in my templates that need to be translated to German. The above example for the i18n function makes sense, but I still have a few questions. First, how does the system know when to use the German version versus the default translation (English in my case)? Is it done via the language encoding sent by the user's browser? For example, let's say I have {'My string'|i18n('/some/block')} in my template. If the browser sends [en-us] to the page, will it display 'My String', and if the browser sends [de] will it perform the i18n lookup? Second, do I place my translations in {path to ezpublish}/share/translations/ger-DE/translation.ts? Third, is there a document outlining the structure of the .ts files and how you modify them? And how does '/some/block' relate to that structure? From snooping around the admin console code, it appears that you call it via what is listed in the <name> tag in the context. However, this does not appear to be working for me. I added the following to ger-DE/translation.ts under the "design/standard/layout" context:
<context>
<name>design/standard/layout</name>
<message>
<source>Home Page</source>
<translation>Startseite</translation>
</message> . . . I then added this line to my pagelayout.tpl file for my siteaccess: <a href="">{'Home Page'|i18n('design/standard/layout')}</a> I then flushed all the caches. Changed my browser to send "de" as the primary/preferred language code, but the text still comes up "Home Page" rather than "Startseite". Maybe I am missing some fundmental understanding of the system, so an application of the clue-by-4 followed by a "read this doc more closely" would not be unwarranted. :)
|