Differences between revisions 1 and 2
Revision 1 as of 2008-06-26 12:26:10
Size: 974
Editor: kfc
Comment: Created by the PackagePages action.
Revision 2 as of 2010-03-17 13:08:52
Size: 974
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Resource Bundles

To start using resource bundles

Directly in the root of the source-folder, make a file called "<<somename>>.properties".

In the file you want localized, add a field:

    private static final ResourceBundle RB = ResourceBundle.getBundle("<<somename>>");

In your IDEA, choose File->Settings->Errors, find "Internationalization" and check "hardcoded strings".

Now you can write the string as English text in the code, and press Alt-enter on it. That should automatically introduce a call to RB.getText("...whatever you choose in the dialogue..."), returning the English text.

Translating your texts

To start translating text to other languages, copy "<<somename>>.properties" to "<<somename>>_da.properties" (_da can of cource be another language code).

The files should group in your IDEA project tab. By marking the group and pressing F4 you can start writing translations for all present properties files.

ResourceBundles (last edited 2010-03-17 13:08:52 by localhost)