Friday 14 July 2006 12:03:57 am
Salut! There are 3 approches if you can't find already translated text in the exisiting translations: 1. Add missing translation to existing files under share/translation. This is less flexible since you need to take care about future updates, but of course the fastest way to add missing untranslated labels. 2. Create translation extension: Extension structure:
extension
|
| - - mytranslationext
|
| - - settings
| | - - site.ini.append.php
|
| - - translations
|
| - - pol-PL
| | - - translation.ts
|
| - - fre-FR
| | - - translation.ts
|
| - - untranslated
| - - translation.ts
Source: extension/mytranslationext/settings/site.ini.append.php
<?php /*
[RegionalSettings]
TranslationExtensions[]=mytranslationext
*/ ?>
This is example content of untranslated translation.ts XML file. This is source file for other translation used in the extension. Use QT Linguist to make the translation: Source: extension/mytranslationext/translations/untranslated/translation.ts
<!DOCTYPE TS><TS>
<context>
<name>extension/mytranslationext</name>
<message>
<source>Example lable</source>
<comment>Example comment</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>More examples</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
In templates use:
{'Example'|i18n( 'extension/mytranslationext' )}
Where i18n as parameter takes context name from your extension translation.ts. 3. Define translation with missing strings as an array then check current object locale and display correct translation. I would recommend use translation extension.
Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog
|