Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Localization problems
Localization problems [message #1453862] Mon, 27 October 2014 16:16 Go to next message
Octavian Motataeanu is currently offline Octavian MotataeanuFriend
Messages: 2
Registered: June 2014
Junior Member
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 07:45 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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?
Previous Topic:How to add draw XY graph to RAP
Next Topic:Can we use the Dependency Injection feture of E4 in RAP
Goto Forum:
  


Current Time: Thu Apr 25 14:31:09 GMT 2024

Powered by FUDForum. Page generated in 0.02925 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top