[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 10:45:25 PDT 2009


Good point.

http://www.mathworks.com/support/solutions/en/data/1-1CCYK/?solution=1-1CCYK
says "don't do that":

"This is a bug in MATLAB. MATLAB uses the underlying Windows Language Settings
  for outputting answers, which could be set to one of the languages that use
  commas to symbolize a decimal. However, it does not recognize this as a proper
  number when it is used in a function call.

  As a workaround, the user can just replace the comma with a point."

I searched http://mathworks.com for "comma decimal"

Also, try searching google with:

site:mathworks.com matlab comma decimal

or

site:mathworks.com matlab comma decimal

See
http://www.mathworks.com/support/solutions/en/data/1-17JJI/index.html?solution=1-17JJI

BTW - Below is an estimate of the magnitude of the task.
Thre are about 1500 Java files in 115 packages that are needed to run the
Ptiny version of Ptolemy, which is very close to what is used by Kepler.  I would guess
that there are not more than 500 Kepler Java files, so we are looking at less than 2000
Java files overall.  At 5 files/hr., this is 400 hours.  At 10 files/hr., this is 200 hours.
That is not including time spent hashing out a design.  Also, this estimate does not include
jar files in ptII/lib, such as diva.jar that need to be localized.

_Christopher

Edward A. Lee wrote:
> 
> 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
>>>>
>>>> : (
>>>>
>>>
>>>
>>>
>>

-- 
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