Page 1 of 1
more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Aug 25, 2011 12:21 pm
by tgs
Hi
Is it possible to set the i18n language for example to english (en) and the numberformat to German (DE) like 'en,DE' in the onSolutionOpen method'?
Users of my solution in Germany would like to start the application with the 'en' i18n locale setting, but don't like the automatic setting of the numberformat (217.436,17 instead of 217,436.17). It would be also helpful to be able to set different local keyboard settings.
Could it be possible to have the opportunity to set the language locale i.e. to english (en) and the numberformat and keyboard settings to the locale settings of the computer of the user (i.e. DE)?
Regards
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Aug 25, 2011 5:29 pm
by jcompagner
no thats not easy possible in servoy, because if you set the locale to 'en' then that is used by default throughout the system including the Date/Number format classes
Why can't you use a 'de' locale?
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Aug 25, 2011 5:55 pm
by tgs
Because the default language setting of the solution should be english (en). Users from Germany (de) logging in with i18n.setLocale('en,EN') and load the english i18n keys. Also users from Italy, Scandinavia and so on if they won't like to localize the software. This guys are asking me why don't they get the number/date format of the country settings of their computer?
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Aug 25, 2011 6:07 pm
by jcompagner
and that is because you are overwriting their systems Locale..
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Aug 25, 2011 6:48 pm
by tgs
Ok, but the users would open the solution with the english i18n keys and have their system locale for number/date.
As I understand, is the only way to do this by setting all i18n keys default to i.e. english. But how should I manage this if other users would like to localize the i18n keys to their homelanguage? And do I have to remove all i18n key values in i.e. german? The i18n locale should only set the solution language and not the format of i18n locale!
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri Aug 26, 2011 10:52 am
by tgs
Hi Johan,
I will show you an example of the language and format settings on my Mac OSX. All the labels and items in english, but the formats are in german. That is what I would like to have for the i18n.locale settings in Servoy. BTW, I have the same on Win 7 pro. Installed Win OS in english language and format and keyboard settings in german.
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Aug 31, 2011 2:17 pm
by jcompagner
thats currently just not possible, the locale of a client is now used for everything
What you want is that you be able to set a locale special for the language
that we only use for getting the text.
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Aug 31, 2011 2:41 pm
by tgs
That's right! What do you think, could this be a feature for the future? Perhaps in 6.1?
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Aug 31, 2011 2:46 pm
by jcompagner
make a case for that.
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Nov 30, 2011 9:41 pm
by tgs
Hi Johan,
I have read about some new features in Java 7 especially the changes for the locale. New is a different setting of 'Display' and 'Format'.
- Code: Select all
Locale.setDefault(Locale.Category.DISPLAY, Locale.GERMAN);
Locale.setDefault(Locale.Category.FORMAT, Locale.UK);
Makes this possible for Servoy to implement the i18n settings as discribed in my posts above?
Regards
Re: more options for i18n.setLocale
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Dec 01, 2011 2:09 pm
by jcompagner
yes that looks like it maps on your request.
Problem for this is that to fully support this throughout our code in smart and webclient we need to compile against java7 and that won't happen anytime soon.