gettext的替代品? [英] Alternatives to gettext?

查看:22
本文介绍了gettext的替代品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何通用的本地化/翻译替代 gettext?

Are there any general localization/translation alternatives to gettext?

开源或专有并不重要.

当我说 gettext 的替代方案时,我指的是一个用于国际化的库,具有某种本地化后端.

When I say alternative to gettext, I mean a library for internationalization, with a localization backend of sorts.

我问的原因是因为(除其他外)我发现 gettext 处理事情的方式有点繁琐和静态,主要是在后端位.

The reason I'm asking is because (among other things) I find the way gettext does things slightly cumbersome and static, mostly in the backend bit.

推荐答案

首先我认为 gettext 是目前最好的解决方案之一.

First of all I think gettext is one of the best at this point.

您可以查看 Boost.Locale,它可能会提供更好的 API 并使用 gettext 的字典模型:http://cppcms.sourceforge.net/boost_locale/docs/(不是 Boost 的官方部分,仍处于测试阶段).

You may take a look on Boost.Locale that may provide a better API and use gettext's dictionary model: http://cppcms.sourceforge.net/boost_locale/docs/ (not official part of Boost, still beta).

如果你不喜欢 gettext...

这些是翻译技术:

  • OASIS XLIFF
  • GNU gettext po/mo 文件
  • POSIX 目录
  • Qt ts/tm 文件
  • Java 属性,
  • Windows 资源.

现在:

  • 最后两个全是废话……翻译和维护非常难用,不支持复数形式.
  • Qt ts/tm -- 需要使用 Qt 框架.具有与 gettext 非常相似的模型.不错的解决方案,但仅限于 Qt.在通用程序中不太有用.
  • POSIX 目录——没有人使用它们,不支持复数形式.废话.
  • OASIX XLIFF——标准"解决方案,依赖于 XML,甚至 ICU 也需要编译成特定的 ICU 资源才能使用.翻译工具有限,我不知道有什么库支持 XLIFF.复数形式不太容易使用(ICU 仅在 4.x 版本中提供了一些支持).
  • Last two total crap... Very hard to use translate and maintain, do not support plural forms.
  • Qt ts/tm -- requires usage of Qt framework. Have very similar model to gettext. Not bad solution, but limited to Qt. Not so useful in generic programs.
  • POSIX catalogs -- nobody uses them, no plural forms support. Crap.
  • OASIX XLIFF -- "standard" solution, depends on XML, even ICU requires compilation to specific ICU resources for use. Limited translation tools, I don't know any library that supports XLIFF. Plural forms not so easy to use (ICU included some support only in 4.x release).

现在我们有什么?

GNU gettext,被广泛使用,有很好的工具,有很好的复数形式支持,在翻译社区很受欢迎...

GNU gettext, widely used, has great tools, has great plural forms support, very popular in translators community...

所以决定,你真的认为gettext不是那么好的解决方案吗?

So decide, do you really think that gettext is not so good solution?

我不这么认为.您根本没有使用过其他解决方案,因此请首先尝试了解它的工作原理.

I don't think so. You haven't worked with other solutions at all, so try to understand how it works at first place.

这篇关于gettext的替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆