views:

384

answers:

1

Are there any general localization/translation alternatives to gettext?

Open source or proprietary doesn't matter.

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

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.

+4  A: 

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

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


Edit:

If you don't like gettext...

These are translation technologies:

  • OASIS XLIFF
  • GNU gettext po/mo files
  • POSIX catalogs
  • Qt ts/tm files
  • Java properties,
  • Windows resources.

Now:

  • Last two total crap... Very hard to use translate and maintain, do not support plural forms.
  • Qt ts/tm -- requires usege 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).

Now what do we have?

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

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

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

Artyom
See, this is an answer I was looking for. Some actual alternatives. Doesn't matter if they're good or bad, just that I can see different ways of doing things. Apparently there aren't so many, but that's not the point. ;)
Tor Valamo
Translation these days is not done in Notepad, there are WYSIWYG tools for localization and as for development.Java or Windows resources are not in any way more difficult to translate and maintain than anything else.
Mihai Nita
Plural forms in gettext are not enough for some languages, and anyway cramming plural forms in the string is something only geeks can handle, but not normal translators (with linguistic background).Java properties can handle plurals, see MessageFormatExample: "There {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}.");Looks like crap (same as gettext)The Windows resources go beyond strings. You can translate in a WYSIWYG environment and see the dialogs and menus, change the fonts (some languages need that), there are tools to validate for double quick-keys, etc.
Mihai Nita
AFAIK Qt ts/tm has no support for plural forms too.
bialix
@Mihai The range in pural forms is far from good enough, you usually need an simple equation. XLIFF and gettext support this (however each one in little bit different wat) and Java properties are not good enough for these urposes. Plural forms is quite compilcated issue and so far gettext provides best solution so far.
Artyom
@bialix Qt has plural forms suport, but the model is little bit different from gettext. See: http://doc.trolltech.com/qq/qq19-plurals.html
Artyom