i18n.setLocale: HOW TO USE IT

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

i18n.setLocale: HOW TO USE IT

Postby pbakker » Wed Feb 16, 2005 12:07 pm

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby ROCLASI » Wed Feb 16, 2005 12:27 pm

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Postby pbakker » Wed Feb 16, 2005 12:46 pm

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Odysseus » Fri Feb 18, 2005 12:47 pm

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
Odysseus

Citizen of Old Europe
Odysseus
 
Posts: 205
Joined: Wed Sep 10, 2003 9:34 pm
Location: Belgium

Postby jcompagner » Fri Feb 18, 2005 3:26 pm

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
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8841
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby pbakker » Fri Feb 18, 2005 3:36 pm

Tnx. guys, for the comments.

Johan, could you explain the difference in Servoy between selecting:
- Nederlands (Nederland)
- Nederlands (Belgie)

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby jcompagner » Fri Feb 18, 2005 3:53 pm

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..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8841
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Odysseus » Fri Feb 18, 2005 3:55 pm

Because "belgies" can be something different....


Great example in Belgium we write it like "Belgisch" :wink:
Odysseus

Citizen of Old Europe
Odysseus
 
Posts: 205
Joined: Wed Sep 10, 2003 9:34 pm
Location: Belgium

Postby pbakker » Fri Feb 18, 2005 3:59 pm

Tnx for the explanation.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 2 guests

cron