Why store the internationalization of "words" in separate (xml) files?

I read a little about how people do internationalization. It seems that the general consensus is to save these lines in a separate file (usually xml) and load it when necessary.

I am wondering why not just store these rows in a database? isn't it better?

The btw nature of my application is the application for the website.

+3
source share
3 answers

The most important thing is to store your string tables outside of your compilation units so that the inclusion of updated translations does not require reconnection. This allows you to add new or updated translations at a later time without any problems.

, . , . , , , .

+4

- . @zerkms, .

, , ( XML).

, , . , .

+3

If you store in the database, you will enter additional overhead for querying the database each time you switch to "local."

This is the reason for resource packages. You pack it with the source code, but you do not need to change the code to add language support.

You can also subclass the resourcebundle class yourself and implement jdbc support so that locale-specific strings are stored in the database.

http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

+1
source

All Articles