Why use GNU gettext?

2019-03-01 06:06发布

Why should I use GNU gettext for internationalization? I am working on developing wordpress themes and that's what is bundled with wordpress and obviously what is recomended.

However, I come from a game development background where localization is done differently and I can't seem to see the advantage of gettext over methods I used to use.

I am struggling over the debate, should I use gettext that is recomended for this technology, or use methods I am more familiar with from my game dev days that also provide more extensibility and flexibility than gettext.

Some of my internal debate undoubtably comes from my inexperience with gettext and my struggles with the POeditor UI. If you all could help me understand why gettext is so commonly used, and why I should use it, would be much appreciated.

1条回答
叛逆
2楼-- · 2019-03-01 06:28

First of all, you didn't provide any examples or advantages of your technologies.
So why GetText?

  1. Easy to translate. Translators don't have to bother themselves with any development concepts: they just take a .po file, open it up and translate in an easy-to-use editor where they have only source language, destination language and, possibly, plurals pattern.
  2. Easy to maintain both for developers and for translators. A developer makes a .pot catalog, gives it to all of his/her translators, they update their .po files (again, with a single command — «update from pot file») and have new strings above the translated ones, so they can quickly update the translations.
  3. Easy to develop internationalizable applications. In the best case you have only to wrap your strings with a _ function.
  4. It's a cross-platform solution having ports for many OSes and programming languages.

So why not GetText? Particularly if it's a default solution in WordPress? I believe your theme/plugin won't be accepted by the community if your i18n technique is different from the one used in this particular community.

查看更多
登录 后发表回答