Replacements for gettext

后端 未结 5 1749
野趣味
野趣味 2021-01-13 07:56

We use gettext for translations in our product, but have had a lot of problems with it:

  • Can\'t use a language unless the system supports it.

On

5条回答
  •  盖世英雄少女心
    2021-01-13 08:37

    Can't use a language unless the system supports it.

    That has nothing to do with GNU gettext - because that only handles the translation part. But it's true, that if the system is not able to show any chinese characters, then you will have problems with China.

    Uses environment to work out language

    That's a good choice, but you can always set the language yourself, overriding the environment. This way, you can make it use any language, based on your choice.

    Can't set a default language

    That's incorrect - default language is always the built-in language, and if you want to have another language, just switch to it. It simply cannot be simpler than one line of code.

    Encoding the are returned vary between UTF-8 and current local encoding.

    If you're in the position to pick an internationalization tool, then you are also in the position to choose, what character encoding you want to use for your texts. Some projects use utf-8 for all languages (my preference), some use the locale encoding.

    Does anyone know of an open-source translation libraries that provide a more useful interface?

    No, sorry - I fail to see any problem with GNU gettext :-)

提交回复
热议问题