views:

45

answers:

1

We are currently i18n'g our platform. The code base for platform and the product's built on this platform is huge and has many hard coded strings (except the UI where we externalized the labels etc).

I need some suggestions on to use gettext or Java i18n. I only have limiting understanding on the benefits and understanding of gettext. What is gettext going to provide other than what is already provided by Java i18n?

Thank you in advance.

+1  A: 

For me leading reason would be:

I18n also supports proper handling of plurals:

System.out.println(i18n.trn("Copied file.", "Copied files.", 1));
// will print "Copied file."

System.out.println(i18n.trn("Copied file.", "Copied files.", 4));
// will print "Copied files."

This example is not the best. It should say "supports proper handling of plurals" in target languages. That's because there are languages that could have more than one plural form (there are quite a few languages like that in fact).

Also, you will have fallback language (English I guess) integrated into your source code which is good (I believe it is better to show English text than key name).

The one concern that I have, but it might be invalid: although gettext commons are released under the terms od Apache 2.0 license, it requires Gnu gettext installed on the system and (correct me if I am wrong) this one is GPL licensed (or L-GPL licensed if you happen to run Linux). If my assumptions are correct, this would mean that unless your application is Linux-only, you would have to open source it.

Paweł Dyda