Skip to main content
Last updated September 25, 2012 11:03, by Stefan Lundgren

Nb Translator

This is a tool to help translate an NetBeans platform application in run time.

To use this tool you have to use a modified version of NbBundle in your Maven project then it will be possible to change bundle values live and see the changed result directly in the application.


User or translator

A user or translator is one that runs the application based on the NetBeans platform. This is the expected work flow for this group:

  1. Run the application as usual
  2. Open the Nb Translator project file
  3. For small fixes the user can press Shift+Ctrl+Alt+M to mark a text and click on it then an editor pops with the text of that component can be changed.
  4. For larger translation work, open OmegaT and create a project then populate export all bundles from this plugin to OmegaT project. Refresh and start translation in OmegaT. When completed use the this plugin to import all the new bundles in the Nb Translator project and se the changes live in the application.
  5. Send the Nb Translator project file back to the developers team so it can be imported and be a part of the next release.


A developer of a NetBeans platform application is expected to use NetBeans IDE as it's developer environment the Nb Translator contains one plugin this environment. This is the expected work flow from the developers perspective:

  1. Replace all org.openide.util.NbBundle to org.openide.util.editable.NbBundle (module from this project) in the source projects.
  2. Create a Nb Translator project file based on the source projects in the developers NetBeans IDE via a wizard from the plugin.
  3. The developer team sends the single project file to some selected user or translator
  4. After translation the file is sent back to the developer team who then imports the changes to the source projects bundle files via another wizard from this plugin. The changes can now be a part of the next release of the application.

Nb Translator - Platform plugin

When a Nb Translator project file is opened all bundle resource requests will be tunneled thru the changes made in the project file, when the file is closed thinks will be back as usual. When the file is open a shortcut (shift+ctrl+alt+m) will be added to the global application.


When shortcut is pressed red square will mark components under the mouse pointer select a text by clicking on it then the editor will appear.


In the editor you can:

  1. Search on a text and component name to find the correct texts to change.
  2. See same component text in all other languages available in the source code
  3. Change the text direct in the application


From the search you can search among all text from the source projects.


The plugin can interact with OmegaT by export bundles to OmegaT and handle import of translated files. Changes can be viewed in the application direct after import.


Nb Translator - IDE

The IDE plugin will extract a selection of bundles based on the source project. It will after translation import changes to the correct bundle files

Under the tools menu you can find a submenu Nb Translator with selections to create or import a Nb Translator project file.

Replace NbBundle

The org.opeide.util.NbBundle has to be replaced by org.openide.util.editable.NbBundle both in *.java and *.form files in the source projects. The added feature is that editable.NbBundle can be plugged with a different is implementation of the static methods in the original NbBundle, default implementation is uses the old util.NbBundle methods.

Create Nb Translator project

The create wizard contains too selections one is what source projects to include the other what languages to include.

Select source project

By default all open project will be included it its not correct remove them and add the correct ones.

Select languages

The wizard will find all available bundle languages from the source projects. The selected languages will be searchable from the platform plugin and it can later be the source language in OmegaT project export.

Import Nb Translator project

First select the Nb Translator project file to import

The language selection will display all languages that has changes to be imported you can then select what languages you are interested in importing to your source projects.

In the last step all changes will be listed if some thing will affect the real import it will be displayed and it will require a manual selection if the change will be imported or ignored. After the import has been done a log file will be opend.

From here its up to you to commit the changed or revert then in the version control system to include it in the next product release.


Hopefully this project will get a lot of contributors and users to make it a perfect and useful plugin for all that uses netbeans platform.

At the moment its a proof of concept project only tested at maven projects.

Please Confirm