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

  • megaupload captcha

    Someone make a Javascript-based captcha cracker for megaupload. It's strange to see those captchas again because I idly myself wrote a…

  • zombie ghosd

    I was tickled to discover another IBM developerworks article on one of my abandoned hacks and that both it and its predecessor have been translated…

  • gat, a git clone in haskell

    I've been pretty busy with work lately, so I may as well dump this on the internet before it gets too dusty. Though I think I understand Git decently…

  • 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