i18n.setLocale: HOW TO USE IT

Hi,

I wanted to use i18n.setLocale, but cannot think of what to put into the two Sting params. Searched the docs and Forum, couldn’t find it, tried the sample code, but that isn’t there, so: who knows?

Paul

Looking in the servoy.properties file my guess it’s like en,US for US english. Probably nl for dutch, fr,BE for belgian french, fr,CA for canadian french, etc.

Hope this brings you into the right direction.

aha, yep, it certainly helps.

But then I have the following Q’s:
1- Why the two indicators for a Locale, when the I18N keys only have one identifier for the locale?
If I look in the Preferences, I see I can select, for example:

  • Nederlands (Nederland)
  • Nederlands (Belgie)

What is the difference between selecting the first and the second? I guess nothing in the area of I18N, since that only has one identifier. Probably Date/time/currencies?

2- Can we get a function to retrieve all the combo’s possible, or extend the getLanguages(0 function by an extra column holding this info?

Paul

I think the locale is (historically) used for keyboard settings (among other things such as currency). And there you’ll have the difference between
Dutch (Netherlands) → QWERTY
Dutch (Belgium) → AZERTY

Since this has no influence I18N you don’t need it

HTH

see:
http://java.sun.com/j2se/1.4.2/docs/api … ocale.html

for all possibilities. This part is the most importand:

The language argument is a valid ISO Language Code. These codes are the lower-case, two-letter codes as defined by ISO-639. You can find a full list of these codes at a number of sites, such as:
http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt

The country argument is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as:
http://www.chemie.fu-berlin.de/diverse/ … _3166.html

Tnx. guys, for the comments.

Johan, could you explain the difference in Servoy between selecting:

  • Nederlands (Nederland)
  • Nederlands (Belgie)

Paul

All different things like regional settings like currency ect..
The i18n currently only uses the language part. This will be changed later on. To also include the country specification. Because “belgies” can be something different for some words.. Currently this can’t be done, because there is only a selection on language..

Because “belgies” can be something different…

Great example in Belgium we write it like “Belgisch” :wink:

Tnx for the explanation.

Paul