[kepler-users] Where to go with the problems of internationalization or how create account into forum?

Christopher Brooks cxh at eecs.berkeley.edu
Tue Sep 22 07:28:06 PDT 2009


Hi Anatoly,
Yes, this would have to be addressed.

I think the way to do this would be to make the expression parser Locale aware.

I'm not sure if this is possible, but the idea is that hopefully the Locale
could tell us that if we were using a Swedish Locale, we would use ',' instead
of '.' as the decimal point.

As an experiment, you could try commenting that code out.
A more permanent solution might be to check a property such as user.region
and if it is set to anything other than "US", skip setting the Locale.
-Duser.region=US

Something like:
    String userRegion = ptolemy.util.StringUtilities.getProperty("user.region");
    if (userRegion.length() == 0 || userRegion.equals("US")) {
        java.util.Locale.setDefault(java.util.Locale.US);
    }
(BTW - I did not compile the code above, so it might not work)

You would then need to pass -Duser.reqion=UA to Java at startup.

This is all conjecture on my part though.

See
http://www.mail-archive.com/ptolemy-hackers@eecs.berkeley.edu/msg01130.html
and
http://www.mail-archive.com/ptolemy-hackers@eecs.berkeley.edu/msg00705.html

_Christopher

Anatoly Loy wrote:
> And current version of Kepler also contains similar lines:
> code\kepler\trunk\modules\loader\src\org\kepler\KeplerConfigurationApplication.java:
> 
> 		try {
> 			java.util.Locale.setDefault(java.util.Locale.US);
> 		} catch (java.security.AccessControlException accessControl) {
> 			// FIXME: If the application is run under Web Start, then this
> 			// exception will be thrown.
> 		}
> 
> 
> 2009/9/22 Anatoly Loy <anatoly.loy at gmail.com>:
>> It turns out that Kepler (more precisely, Ptolemey) uses the locale only "US".
>>
>> Comment about this was found in version 1.0.0
>> kepler.jar\ptolemy\actor\gui\MoMLApplication.java:
>> [src]
>>         / / Even if the user is set up for foreign locale, use the US locale.
>>         / / This is because certain parts of Ptolemy (like the expression
>>         / / Language) are not localized.
>>         / / FIXME: This is a workaround for the locale problem, not a fix.
>>         / / FIXME: In March, 2001, Johan Ecker writes
>>         / / Ptolemy gave tons of exception when started on my laptop
>>         / / Which has Swedish settings as default. The Swedish standard
>>         / / For floating points are "2,3", i.e. using a comma as
>>         / / Delimiter. However, I think most Swedes are adaptable and
>>         / / Do not mind using a dot instead since this more or less has
>>         / / Become the world standard, at least in engineering. The
>>         / / Problem is that I needed to change my global settings to
>>         / / Start Ptolemy and this is quite annoying. I guess that the
>>         / / Expression parser should just ignore the delimiter settings
>>         / / On the local computer and always use dot, otherwise Ptolemy
>>         / / Will crash using its own init files.
>>
>>         try (
>>             java.util.Locale.setDefault (java.util.Locale.US);
>>         ) Catch (java.security.AccessControlException accessControl) (
>>             / / FIXME: If the application is run under Web Start, then this
>>             / / Exception will be thrown.
>>         )
>> [/ src]
>>
>> Partly for that reason was unable to ensure that Kepler used in the
>> folder configs\ptolemy\configs\kepler instead of files
>>
>> uiContextMenuMappings_en_US.properties
>> uiDisplayText_en_US.properties
>> uiMenuMappings_en_US.properties
>>
>> appropriate
>>
>> uiContextMenuMappings_uk_UA.properties
>> uiDisplayText_uk_UA.properties
>> uiMenuMappings_uk_UA.properties
>>
>> : (
>>
> 
> 
> 

-- 
Christopher Brooks (cxh at eecs berkeley edu) University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718	      (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480



More information about the Kepler-users mailing list