Question

For my internship i've been asked to do some research on software internationalization and the current practices and solutions.

I've done some research and have come to no viable solution. My project manager has asked that I ask on stackoverflow,

What are the current practices that you guys at your job do in order to internationalize your Java software?

EDIT

The following is a summary of my research in case any other person is interested in my findings:

As the software is written in Java, RessourceBundles are obviously used. RessourceBundles provide good key value lookup with fallback to default values if no specific translation for the current locale exists. ResourceBundles are also not limited to translation of text but to internationalization of, well, resources. For example, color or images mean differente things for different cultures.

While all that is nice, just purely using Java PropertiesResourceBundles fails to provide metadata for the translator and fails to handle plural forms.

GNU Gettext takes an alternate approche to internationalization. Messages are written in source code in english and then extracted and stored into a file. The extraction program searches for function calls and extracts the parameters. For example, tr("Hello, World!") the command line utility xgettext would search for occurences of the function "tr" and extract all string literals.

Java implementations of gettext exist, such as:

What gettext provides that ResourceBundles don't is plural handling and context for translations.

Was it helpful?

Solution

Have a read of this trail as it should answer most of your questions.

For web applications we use the standard facilities offered by JavaEE. That essentially means passing a message bundle into a JSF page and then using mark up that looks like this #{msg.hello} in the page. "msg" is the name of the message bundle and "hello" is the key that will be used to look up the translated string.

The translations are all held in properties files which have a standardized format and naming convention. The process works in much the same way for client applications although I don't feel it's quite as smooth

As I understand it professional translators have software that will load properties files and assist them in producing the translations. Adding comments to your properties files is useful so the translators have some context when translating.

OTHER TIPS

In addition to other answers I would suggest using some technique/software that can analyze/check that all localization resources in your project are in sync.
That usually should be done during build time, so you can find/catch errors earlier.

One of such tools that I personally use and would recommend is i18n-maven-plugin

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top