View Single Post
Old 12-30-2011, 05:08 PM   #46
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
/opt/amazon/ebook/config/locales/ files

So, a bit about the files found in /opt/amazon/ebook/config/locales/

All files in there should be "standard" Java properties files (very similar to Windows .ini files). Because these files are evaluated *NOT* only by Java, but also by the built-in "langpicker" parts, you may want to be extra-cautious about their format. Even slightly "strange" formats *may* have been a cause for fuckups, as reported earlier in this thread.

So, to be on the safe side:
- let every line be a line in the "key=value" format.
- use only Unix line separators, and do not have blank lines in the file.
- make sure the last line in the file is terminated by a newline.

This may be over-cautious, but see above.
So, the general format of an entry (using a concrete example) is:

Code:
locale=pl
locales.supported=pl-PL
display.name.pl-PL=Polski
posix.id=en_US.UTF-8
or, in pseudo-format:
Code:
locale=<LOC_LANG>
locales.supported=<LOC_LANG>-<LOC_REG>
display.name.<LOC_LANG>-<LOC_REG>=<NAME>
posix.id=<POSIX_ID>
* LOC_LANG is the general locale (the language).
* LOC_REG is the specific variant (e.g. the region).

For language and region codes, you can find as much information as you want. I'll stick with https://wiki.mozilla.org/L10n:Locale_Codes and http://docs.oracle.com/javase/1.5.0/...il/Locale.html, and let you find your way from there. In almost all applicable cases, the language is written in lower case, and the region is the same as the language, but in uppercase. If this is *not* the case for your particular localization needs, you will certainly know about the subtleties.

locale is required, and must be set to the language code.

locales.supported is required, and must be set to the concrete region code this locale supports. This argument *may* (presumably) be present more than once.

display.name.<LOC_LANG>-<LOC_REG> must be present for each supported region, and its value is the string identifying that locale to the user in the user interface (see above for an example).

posix.id is, in principle, optional, and refers to the POSIX id of the chosen locale which is used in the underlying system. It it is not set, it will be determined from the abovementioned settings. HOWEVER, not all valid locales are available in the Linux system underlying the Kindle, so is is strongly recommended to always set this value to "en_US.UTF-8".

The above example shows all of these settings.

While there is no particular file naming to observe, I strongly recommend to use <LOC_LANG>_<LOC_REG>.properties, so for example "pl_PL.properties" for the example above.

Last edited by ixtab; 12-30-2011 at 05:32 PM.
ixtab is offline   Reply With Quote