Sunday 27 August 2006 3:59:34 am
Hi there
I would like to use the i18n operator on string variables but have problems using ezlupdate with this. Example:
{def $countries = ezini('CountrySettings','Countries', 'content.ini')}
<select >
{foreach $countries as $current_country}
<option value="{$current_country}">{$current_country|i18n('my/countries')}</option>
{/foreach}
</select>
What I want to achieve is that the countries are translated in the current language, even though they are only in English in the ini file. The translation itself works absolutely fine (provided I added the proper entries in the translation.ts) , the only problem is the ezlupdate program. The program exits when encountering an argument that is not enclosed by quotation marks. I can certainly understand that it is not possible to create a proper entry in the translation.ts file for an argument which is not a string. But I don't see why the program does not just skip this entry and continues scanning the rest of my templates.
I have read the bug reports regarding this problem but they were closed without giving a solution. The suggestion by Marc Boon to use
{'%var'|i18n('context','comment',hash('%var',$var))}
does not work as this way the content of the variable is not translated, just passed through. My current workaround is to remove the offending line in my template, run ezlupdate and then add the line again, which is certainly workable but error-prone. So here finally my question: Could someone give me some pointers on how to change the exlupdate such that it just skips invalid arguments (with an error message)? Or, if that does not cause problems with any licenses, couldsomeone contribute such a version, preferably for both Windows and Linux? Thanks Claudia
|