How to localize the languages of a dictionary?

Started by axin, 16. February 2010, 13:18:14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

axin

Hi,

I was wondering how the languages included in a dictionary are localized?
For example, a English - German dictionary opened on a German system should display "Englisch -> Deutsch" instead of "English -> German".
Is this already handled in the J2ME version? How?

If not, I suggest we use a simple text-replace feature and include a list of all available languages into our localization files (DictionaryForMIDs.languages / strings.xml):
When the dictionary is loaded, the program would read out the languageXDisplayText property for the English name and search a language lookup table for that name and its corresponding localized name. This way we could automatically support many of the available dictionaries without recompiling them. If an entry cannot be found in the lookup table, it will of course fall back to using the original languageXDisplayText.

This approach could also support dictionaries like "SMS shorthand <> Definition" or "German zip codes <> City" (by adding "SMS shorthand", "Definition", "German zip codes", "City" as entries to the language lookup table) but we could also say that the SMS shorthand dictionary requires English anyways (as all entries are in English only), so we don't include it into the lookup table.

Please reply as soon as possible as helpful people are already beginning to translate the localization files...

-Achim

Gert

QuoteFor example, a English - German dictionary opened on a German system should display "Englisch -> Deutsch" instead of "English -> German".

Yes, this is done in the Java ME version: a languageXDisplayText of, say, "Sample" is looked up as display text item "LanguageSample" (as defined in DictionaryForMIDs.languages); if there is no display text item "LanguageSample", then the just "Sample" is shown as display text.

Of course any idea to share translations between the Android and the Java ME version is welcome !

Besides: parsing a language file at runtime will not work well for Java ME. Cause (1) there are Java ME implementations that have bugs in their UTF-8 decocer and (2) that makes the startup time a little longer.

Regards,
Gert

axin

I see, thanks for clarifying! I'll check how to use that on Android, probably we can just copy those language names over to the xml file...

-Achim