本文介绍了为什么要使用GNU gettext?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我应该使用GNU gettext进行国际化?我正在开发wordpress主题,这是与wordpress捆绑在一起的,显然是推荐的东西.

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.

但是,我来自游戏开发的背景,本地化的方式有所不同,我似乎看不到gettext相对于以前使用的方法的优势.

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.

我正在为辩论而挣扎,应该使用针对该技术推荐的gettext,还是使用我在游戏开发日更加熟悉的方法,这些方法还比gettext提供更多的可扩展性和灵活性.

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.

毫无疑问,我的一些内部辩论源于我对gettext的缺乏经验以及与POeditor UI的斗争.如果大家都能帮助我理解为什么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.

推荐答案

首先,您没有提供技术的任何示例或优势.
那么为什么要使用GetText?

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

  1. 易于翻译.译者无需费心任何开发概念:他们只需获取一个.po文件,将其打开并在易于使用的编辑器中进行翻译,该编辑器中只有源语言,目标语言以及可能的复数形式.
  2. 易于维护,既适合开发人员,也适合翻译人员.开发人员制作一个.pot目录,并将其提供给所有翻译人员,他们更新.po文件(同样,使用一个命令-从pot文件更新"),并在翻译后的字符串上方添加新的字符串,因此可以快速更新翻译.
  3. 易于开发可国际化的应用程序.最好的情况是,您只需使用_函数包装字符串即可.
  4. 这是一个跨平台的解决方案,具有用于许多操作系统和编程语言的端口.
  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.

那么为什么不使用GetText?特别是如果它是WordPress中的默认解决方案?我相信,如果您的i18n技术不同于该特定社区中使用的技术,那么您的主题/插件将不会被社区接受.

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.

这篇关于为什么要使用GNU gettext?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 00:46