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

Edward A. Lee eal at eecs.berkeley.edu
Tue Sep 22 08:47:32 PDT 2009


As I recall, the main reason for forcing the locale to be US
is because commas have a different meaning elsewhere.
How to parse:

   [1,2]

In Europe, this is a double matrix with one element with value 1,2
(1.2 in the US).

In this US, this is 1x2 integer matrix with two elements, 1 and 2.

I don't know of any way to reconcile this ambiguity (how does
MATLAB deal with it?  This is MATLAB syntax, which we chose
deliberately).

Edward


Christopher Brooks wrote:
> 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
>>>
>>> : (
>>>
>>
>>
>>
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eal.vcf
Type: text/x-vcard
Size: 351 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20090922/31509be0/attachment.vcf>


More information about the Kepler-users mailing list