View Single Post
Old 01-17-2012, 07:43 AM   #6
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
You can only use .properties files to set String values (not Insets etc.). However, this is o problem, because you do not need to *replace* the file, you simply add another file "on top" of it.

This will work because of the way Java resource bundles work. They were designed to be used for localization. Suppose you are looking for a resource named R (in your case "remove.label") in resource bundle B (in your case AreasResources). If you're using en_US locale (as you do by default on the KT), resource lookup will be as follows:

1. does bundle B_en_US exist, and does it contain R?
2. does bundle B_en exist, and does it contain R?
3. does bundle B exist, and does it contain R?

In the above statements, a bundle can be a full-fledged class extending ResourceBundle, or it can simply be a .properties file (which will automagically be loaded using PropertyResourceBundle).

Thus, if you create a file named AreasResources_en.properties (or AreasResources_en_US.properties) at the correct directory (according to the bundle package name), and put ONLY the line "remove.label=ITSWORKING" in it, then your kindle will be using ITSWORKING for that particular entry of the resource bundle.

Hope this is clear enough.

UPDATE: (You may want to take a look at the KT localization thread; we're dealing with exactly such issues at the moment, albeit in a different context. However, getting the Localization tool from git and experimenting with it should hopefully help to understand how these resourcebundle things work).

Last edited by ixtab; 01-17-2012 at 07:47 AM.
ixtab is offline   Reply With Quote