Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

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.
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 5 comments