About Localization...

Added by Rafael Ibraim Garcia Marques over 4 years ago

What exactly I need to do to make this works?
Looking at the JWT jar (3.2.2) I see a "wt.xml" and resolved to use this as a initial template:

  1. Copied the file to my source directory as "wt_pt.xml" and changed the messages
  2. Created a new WXmlLocalizedStrings with WApplication.setLocalizedStrings
  3. Did WApplication.setLocale use "pt" "BR" as Locale

And nothing changes =/
I've tried WXmlLocalizedStrings.use with "wt", "wt_pt", "wt.xml", "wt_pt.xml" and even "mynamespace.wt". Still nothing changed.
What am I missing?

As a side note, I'm using CLOJURE.


Replies (2)

RE: About Localization... - Added by Kip J Mejia 6 months ago

To translate a text in to a particular language is know as Localization. It is a process by which we can change a text to a different language and also we can add some locale-specific components. Swing supports localization in the way that when we localize an application to a particular language and run it in that specific locale then Swing pulls up the localized strings from the resource bundle. After this, the component gets resized by the layout manager. The previous example demonstrates how to localize an application.Check more info from http://cheapessaywritingservice.us/

RE: About Localization... - Added by Koen Deforche 6 months ago

Hey Rafael, it sounds like that should work.

The two calls that are important are:

 WXmlLocalizedStrings bundle = new WXmlLocalizedStrings();
 bundle.use("/package-path/to/wt");
 app.setLocalizedStrings(bundle);
WApplication.getInstance().setLocale(new Locale("pt"))

This should load "wt_pt.xml"

JWt comes with a 'form' example that illustrates these APIs.

Koen

(1-2/2)