Re: XML files containing translations



On Mon, 2001-12-24 at 00:22:42, ERDI Gergo wrote:

> In my project I'd like to use the xml-i18n-tools package to store all the
> translations in one file.

Very good idea.

> The problem is this can mean so many things:
> 
> 	* This can mean two separate <description> tags, with the first
> 	  one included in every locale and the second one only in
> 	  Hungarian ones
> 	* These are two <description> tags, and both are only available in
> 	  one locale ("C" and "hu"), so because of the C fallback, any
> 	  locale other than "hu" should include only the first one, and
> 	  "hu" should include both
> 	* This is one tag, included in "C" and "hu" locale, so if
> 	  locale="hu", only the second one exits, in other cases, only the
> 	  first one exists.
> 
> And maybe other cases as well. I definitely need some clarification here.
> I realize that there are many more issues in selecting the appropriate tag
> because there can be multiple locales set, but this part is very
> straightforward compared to deciding which set of tags to choose from.

I suggest you use e_xml_get_child_by_name_by_lang_list function from GAL.
It returns the appropriate tag for current locale (optionally you can also
provide a list of locales you want to use) and falls back to tag with no
locale specified (without xml:lang attribute).


Zbigniew



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]