Wednesday Jul 29, 2009

Localizing NetBeans Platform Application (2)

As I posted in previous entry, localizing NetBeans Platform Application is simple. You can use Automatic Internationalization feature to modify the codes and Bundle.properties for internationalization task. Also the useful properties editor is prepared.

NetBeans

To distribute your application, you can prepare a ZIP file that contains necessary files. Select Build ZIP Distribution from project menu.

NetBeans

By running the application, you should get localized application... Hmm... it seems that only "Button" is localized on that application. Other UI area e.g. File, Edit, View, Navigate, Tools, Windows and Help are just English. Why??

NetBeans

Because these UIs are being provided by NetBeans Platform, not by user module. When we create application on localized NetBeans, corresponding modules and localized jar files are packaged automatically. However, there is an issue 133901. Due to the issue, currently localized jar files will not be into the ZIP distribution and JNLP application.

To get localized jar files for NetBeans Platform, you can copy files from NetBeans installation. If you have installed NetBeans, you can find localized jar of NetBeans Platform files under the following folders.
  • platform10/core/locale
  • platform10/lib/locale
  • platform10/modules/ext/locale
  • platform10/modules/locale
Note that we are providing two distributions from language point of view. Japanese, Chinese and Brazilian Portuguese are included in standard distribution. Other languages are provided as community contributed languages and included in community builds. You can download both on download page. If you want just ZIP distributions, these are available by the followings.

NetBeans 6.7.1 (including Japanese, Chinese and Brazilian Portuguese) :
NetBeans 6.7.1 Community Languages (See TFL10nCommunityStatus) :
I downloaded the community language build above and I extracted Spanish jar files from it. Then copied into my application. Finally all menu items are now localized into Spanish :)

NetBeans

Tuesday Jul 28, 2009

Localizing NetBeans Platform Application

Localizing NetBeans Platform Application is very simple. You can use GUI form editor even for NetBeans Platform Applications. Good tutorial about internationalization on GUI builder has been updated recently for NetBeans 6.7 release. This tutorial works for 6.1, 6.5 and 6.7 releases.
When you're building GUI form on NetBeans, Automatic Internationalization feature will help your internationalization task. GUI form and properties files will be modified automatically with this option is turned ON.

NetBeans

Pease note that the option will appear on properties window when you select the top component of the form.

NetBeans

Once you enable this option, Bundle.properties will be created and necessary key and value pairs will be added automatically according to your updates on GUI editor. To edit Bundle.properties, there are two ways. "Edit" action will open the contents in usual editor. "Open" action will open a property editor.

NetBeans

The default action is going to open a raw editor (above) . If you choose "Open" from context menu, you can open the special editor for properties files (below). You can add and edit entries by using usual table.

NetBeans

To add new Bundle for languages other than English, select "Add" > "Locale...".

NetBeans

Select language and country code on New Locale dialog.

NetBeans

Once you add a new language, new column will be added in the property editor and you can modify strings and translate them.

NetBeans

Let's run the application. This is a simple example for NetBeans Platform Application running in Spanish locale.

NetBeans
About

NetBeans Globalization

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today