Localization problems [message #1453862] |
Mon, 27 October 2014 12:16  |
Eclipse User |
|
|
|
There are ample examples on how to deal with message/language localization in RAP but no advice/solution that deals with other localization issues.
My specific problem is formatting of numbers or dates based on the localization used. For example, the Java SDK class NumberFormat uses the default locale to return a formatter to be further used. In my application, I need to format both numbers and dates and the classes provided by the Java SDK did this perfectly in RCP, but cannot handle the multi-locale environment of RAP. The alternative for this provided by the RAP SDK is the RWT.getLocale() method, which I used in replacing the direct calls to Locale.getDefault().
My question/problem is how to deal with indirect calls to Locale.getDefault() like the NumberFormat mentioned above, since a RAP version implies duplicating almost all the functionality in Java SDK and replacing Locale.getDefault() with the aforementioned RWT.getLocale()? Is there any way of fixing the problem on a more general basis or do I have to manually check what other Java SDK classes use Locale.getDefault() and duplicate their functionality in RAP?
|
|
|
Re: Localization problems [message #1454294 is a reply to message #1453862] |
Tue, 28 October 2014 03:45  |
Eclipse User |
|
|
|
Don't you use the default methods but the one where you can pass the
Locale e.g.
http://docs.oracle.com/javase/7/docs/api/java/text/NumberFormat.html#getInstance%28java.util.Locale%29
For single-sourcing reasons in our application we have abstracted this
in a FormatProviderService which is different between RCP & RAP.
Tom
On 27.10.14 17:16, Octavian Motataeanu wrote:
> There are ample examples on how to deal with message/language
> localization in RAP but no advice/solution that deals with other
> localization issues.
> My specific problem is formatting of numbers or dates based on the
> localization used. For example, the Java SDK class NumberFormat uses the
> default locale to return a formatter to be further used. In my
> application, I need to format both numbers and dates and the classes
> provided by the Java SDK did this perfectly in RCP, but cannot handle
> the multi-locale environment of RAP. The alternative for this provided
> by the RAP SDK is the RWT.getLocale() method, which I used in replacing
> the direct calls to Locale.getDefault(). My question/problem is how to
> deal with indirect calls to Locale.getDefault() like the NumberFormat
> mentioned above, since a RAP version implies duplicating almost all the
> functionality in Java SDK and replacing Locale.getDefault() with the
> aforementioned RWT.getLocale()? Is there any way of fixing the problem
> on a more general basis or do I have to manually check what other Java
> SDK classes use Locale.getDefault() and duplicate their functionality in
> RAP?
|
|
|
Powered by
FUDForum. Page generated in 0.05187 seconds