>> Hi Stefan,
>>
>> here's my approach (qooxdoo 1.2.x):
>> <code>
>>     __guessSetLocale : function ()
>>     {
>>       // Get the users client locale; we don't care about the variant
>>       var locale = qx.bom.client.Locale.LOCALE;
> 
> 
> qx.locale.Manager.getInstance().getLocale() is the better API here.
> 
> T.

Hi T,
Sorry, but that's wrong! ;)

This method should set the locale based on the client-browser setting!

This method is intended to "guess" (hence the name) the most probable
locale-setting that the user might like _before_ we have user-specific
information (e.g. before login)

And by the way, if we would use your call, this method would just be a
"mgr.setLocale(mgr.getLoocale())" ...senseless, eh?

/Peter

>>       // Client locale not supported?
>>       if (!qx.lang.Array.contains(["de", "en", "fr"], locale)) {
>>         locale = "en"; // ...fall back to 'en' (default)
>>       }
>>
>>       qx.locale.Manager.getInstance().setLocale(locale);
>>     },
>> </code>
>>
>> /Peter
>>
>> On 2010-09-07 12:57 Stefan Andersson wrote:
>>> Does anyone have a good solution to set the language of an application
>>> before the main is run, such that it is possible to retrieve this from
>>> the HTML site's information?
>>>
>>> I am using a CMS which decides the language and it must tell qooxdoo
>>> what language version to use in HTML text or in any other way.
>>>
>>> Stefan

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to