{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner

Interview: Help for Multilingual NetBeans Platform Applications

Peter Rogge (pictured, right) from Germany is yet another developer of NetBeans Platform applications. He's particularly interested in finding generalized solutions for the challenges faced by developers of multilingual applications. Below you find out about him and the projects he's working on around multilingual support for NetBeans Platform applications.

In 2003, Peter changed careers, becoming an application developer, at which point he discovered his passion for Java. In 2008, he started working as a software engineer at H&D International Group in Wolfsburg, where he still works.

H&D offers comprehensive, individual and integrated solutions for the various requirements of modern IT. Most of its customers come from automotive, financial, insurance, service or public sectors, but H&D is also open to new potential markets in various other business branches.

Hi Peter. You've set up a site on java.net dealing with multilingual solutions relating to the NetBeans Platform. Why did you decide to do this?

The main reason for that was that I was searching for a multilingual solution for my German program Traumpalast, which is a dream diary. The user should be able to, at runtime, change the locale of the application via a menu item or toolbar button.

In trying to make this possible, three main themes began to crystalize:

  1. Access to Localized NetBeans modules. Via the localized NetBeans modules, the NetBeans team provides translations of menus, toolbars, dialogs, and so on.

    However, access to these translations is not very easy. Firstly, if an application needs to be able to support multilingual scenarios, you need to download and install modules for each language separately from the NetBeans Download Page. And how do you then access the files in these localized modules and integrate them into your own application?

    Currently 20 languages are supported by NetBeans IDE. The main languages are shown above the line, with community-provided languages below it:

  2. NetBeans Plattform Restarts. Then there's the small detail that the activation of a new language requires a restart of the NetBeans Platform, enabling the newly selected language data to be loaded.

    In this area Jesse Click (issue 168257) and Aljoscha Rittner (Neuerer Neustart der NetBeans Platform) are making good progress. However, when restarting a NetBeans Platform application under Linux / Unix, the configuration data containing the initialization data including locale settings, are not loaded afresh. As a result, for these platforms, changes in the language choice cannot be enabled via a restart, so that currently under Linux / Unix NetBeans Platform applications must be restarts manually in order to read the changes in the configuration files. 

  3. Internationalization of Texts. Once you've overcome these obstacles, you need to translate the texts of your custom modules. However, this task is not too hard, since NetBeans IDE has good internationalisation support, via wizards and templates.

While I was gathering data about these three themes, I came across a lot of information relating to the theme of internationzalization and language switching at runtime. A lot of developers are looking for help about precisely these topics, so that it would be useful to have a generalized approach enabling the user to easily select the desired language for a running application.

Since I've been considering getting involved in the NetBeans Community for some time already, I thought I'd take the opportunity to set up the MultiLingual site,  where I am collecting and making available a wide range of information around this theme, in the form of tutorials and a demo program.

What's the current situation of multilingual support in the NetBeans Platform?

Currently we have the following situation with the NetBeans Platform:

The developer downloads one or more distributions of NetBeans IDE by selecting the desired languages on the download page. After installation the development environment makes the selected language available for developing NetBeans Platform applications. And... that's all.

Firstly, after installation, the developer has the possibility of changing the configuration file to enable NetBeans IDE to start with a new language. However, the condition for this to be possible is that the currently installed version of NetBeans IDE needs to support the selected language in the first place. :-).

Indeed, as a developer it isn't possible for me to say: "NetBeans IDE, generate the ZIP distribution of my NetBeans Platform application in the following localized languages: Language1, Language2, etc." But, why isn't this possible? The language files are available, so why isn't this possible?

Personally, I find this to be a great pity. A missed opportunity. It isn't the case, after all, that the language module needs to be programmed from scratch. Instead, the language files are available and are only needed once, when the application is installed. But what it would take to implement this from the side of the NetBeans team is not something I know enough to comment on.

A small overview of the amount of work that it takes to localize the NetBeans Platform is described in Emilian Bold's „NetBeans Platform Speaks Romanian“, where Emilian describes that someone from a company had to be involved for a month to translate the application... while NetBeans supports more than 20 languages, each of which may require even more or less work than that.

And what exactly would like you to achieve with your multilingual project?

My goal is that the developer programming multilingual applications is able to find all the relevant information on the project homepage from MultiLingual.

To that end, I have provided a wide range of information and links around the abovementioned three themes (the usage of localized NetBeans modules, the restarting of NetBeans Platform applications, and the internationalization of custom texts).

In addition, I created a small demo program that demonstrates the implementation of this information.

The picture mirrors that interest in the NetBeans community for the theme of multilingual support is high. On average, the demo program is downloaded 100 times a month.

What are your next steps in the multilingual project?

In the next and final step, I'd like to refactor the demo program as a small plugin. The plugin will entail the following functionality:

  1. Availability of the plugin on the hompage from Multilingual and in the NetBeans Plugin Portal.

  2. After installation of the plugin, a new sample project will be available in the „Samples/NetBeans Modules“ category in the New Projects wizard (see the NetBeans Project Sample Module Tutorial). The project will let the user create a module that can be integrated into a custom application or into the current development IDE that is being used.

  3. Via configuration, it will be possible to set the language as well as the order of the menus and toolbars.

  4. After choosing a language, the NetBeans Platform will enable it.

  5. Information about how the build.xml file can be configured, for the purpose of copying localized module files into the ZIP distribution.

Here are a few screenshots to show how the whole thing will look:

When did you first make contact with the NetBeans platform?

In 2007, I began programming Traumpalast (German) in Eclipse IDE. Via Traumpalast, dreams can be recorded and analyzed.

Development was going well, although I relatively quickly found myself limited by standard Swing's constraints in terms of application development. Not only did the creation of the GUI take up a lot of time, also the available functionality of Swing components limited my creativity in programming features for my application.

In the middle of 2007 I watched as a colleague created a new view using the Matisse GUI Builder in NetBeans IDE. Not long after :-) I read on the NetBeans home page an article about RCP programming. I immediately realized that RCP programming is exactly what I had been looking for all along.

Next I bought the books „NetBeans RCP – Das Entwicklerheft and „NetBeans 6 - Rich-Client-Entwicklung mit Java“ and spent the next 8 months teaching myself the basics of RCP programming.

At the end of all that, you must have come up with some basic advantages of RCP development and the NetBeans Platform in particular.

Very quickly, the following advantages of RCP development on the NetBeans Platform have become apparent, versus doing so with standard Swing:

  1. NetBeans module system. Extract from the „Definitive Guide to the NetBeans Platform", page 17:

    The NetBeans module system is responsible for managing all modules in the application. It is also responsible for tasks such as creating the classloader, the loading of modules, and their activation and deactivation. The concept of the NetBeans module system is based, as far as possible, on standard Java technologies. The basic idea of the module format originates in the Java Extension Mechanism. The fundamental ideas of the Package Versioning Specification are used to describe and manage dependencies between application modules and dependencies of system modules.
  2. Usage of NetBeans APIs. Such as:

  3. A great community. NetBeans.org, forums, blogs, good tutorials, etc. In particular:

Complete this sentence: "I will be extremely happy when the NetBeans Platform..."

…simplifies the support for mulitlingual application development, in terms of set up, developer access, and user configuration.

The localized language data is being worked on by Jesse Click (issue 168257). The only question remaining to be solved is the usage and integration of localized language data in custom modules and applications.

At the point where these things are working, then issue 168427 can be fixed. That issue prevents changed configuration files from being read when a NetBeans Platform application restarts under Linux / Unix. Currently, configuration file changes, regardless of what they are, are not picked up when the application restarts.

In addition to working on this generalized support for multilingual applications, are you working on any actual NetBeans Platform applications as well?

Yes, coincidentally I happen to have a new potential YANPA (Yet Another NetBeans Platform Application)! I recently made it publicly available on Kenai.com. It is a project named „ABC-List“.

The application is a "thought tool" in the style of Vera F. Birkenbihl. An ABC list is an alphabetical list in which time limits are associated with selected themes. The usefulness of this exercise lies, amongst others, in its encouragement of associative thinking, an improved thought flow, activation of passive knowledge, an enhanced level of creativity, concentration, and analysis capabilities.

Meanwhile, I've managed to integrate more than 20 exercise approaches into the application, bit by bit, over time.

The screenshot below shows a snapshot of release 0.9.1, which I'd like to make publicly available in the next few weeks. The main new feature is the „Historie“ module, where the exercise timeframe over the past 30 days is shown in a list:

Anything else you'd like to share?

Yes, I'd like to thank you for the interview and the readers for taking the time to read it!




{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks