2011

Fusayuki Minamoto's Blog

May 2011 Previous month Next month

Here is a quick memo to localize RHQ4 Graphical User Interface into Japanese.

You can change it to other language by replacing "locale=ja" with your locale.

 

Setup

 

Please read RHQBuild and setup following tools and the database.

 

  • JDK
  • Git
  • Maven
  • Postgres (including kernel parameter changes)

 

It would be helpful to speed up the GWT build time by adding next properties to your setting.xml.

(Thanks to Heiko W.Rupp for this info)

 

            <gwt.userAgent>gecko1_8</gwt.userAgent>

            <gwt.draftCompile>true</gwt.draftCompile>

            <gwt.locale>ja</gwt.locale>

            <gwt-plugin.extraJvmArgs>-Xms512M -Xmx1024M -XX:PermSize=128M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs>

            <gwt-plugin.localWorkers>2</gwt-plugin.localWorkers>

 

You should change the properties according to you environment.

 

Localize and Build RHQ

 

1. Download RHQ sources

 

$ git clone git://git.fedorahosted.org/git/rhq/rhq.git

 

2. Find where localized resource files are should be placed

 

    Explore German resource files to check what kind of files exist in RHQ sources.

 

$ find ./modules -name "*_de\.*"

./modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_de.properties

./modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties

./modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants_de.properties

./modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_de.properties

./modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties

 

3. Create new local resource files for your locale

 

     Copy original resource files to your local resource files.

 

$ cd ./modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client

$ cp Messages.properties Messages_ja.properties

$ cp MessageConstants.properties MessageConstants_ja.properties

 

4. Edit the local resource files with your favorite editor.

 

5. Build RHQ for building  server

 

$ cd $RHQ_DIST

$ mvn -Pdev -DskipTests -Ddbsetup install

 

    Please note that -Ddbsetup option is needed only at the first time.

 

6. Run RHQ server

 

$ cd dev-container/bin

$ ./rhq-server.h start

 

7. Open browser to see the localized UI

 

http://localhost:7080/coregui/CoreGUI.html?locale=ja

 

    Login as rhqadmin and see your localized messages.

 

Use GWT Development Mode

 

Full build of RHQ server takes long time for just checking GWT UI.

You can start your GWT Module on GWT development mode to see the localized view quickly.

 

1. Start "GWT Development Mode" window

 

$ cd $RHQ_DIST/modules/enterprise/gui/coregui

$ mvn gwt:run

 

Screenshot-GWT Development Mode.png

 

2. Push the "Launch Default Browser" button to open a browser

 

    The browser will open the next URL to run the UI on GWT development mode.

 

http://localhost:7080/coregui/CoreGUI.html?locale=ja&gwt.codesvr=127.0.0.1:9997

 

    Login as rhqadmin and see the localized messages on the browser.

 

rhq_jp.png

References

Filter Blog