evan_tech

Previous Entry Share Next Entry
05:26 pm, 4 Feb 04

i18n disambiguation

We finally ran into a translation problem (see point 4) that I've been anticipating: words that are the same in English but different in other languages. We use "None" for "no music" or "no viewers of this poll question", while Russian needs two different words.

I knew somebody has dealt with this before, and I eventually found it in the gettext manual. The (obvious) solution is to disambiguate the strings in your source code: change "None" to "music|None" and "viewers|None". The non-obvious part is what format to use.

Unfortunately, it appears nobody has standardized on a way to do this. I see some projects that include the disambiguation bit after the text, and even Freeciv has their own standard (see their "Q_" macro). But as the gettext manual says, it's nice to put the disambiguation text before (as Freeciv does, too) because you can do a C string trick for the untranslated case.