NetBeans Platform 7.3 In Other Languages

NetBeans IDE 7.3 is available in English, Brazilian Portuguese, Japanese, Russian, and Simplified Chinese. 

That means that you can create an application on top of the framework beneath NetBeans IDE, i.e., the NetBeans Platform, and without needing to do anything at all, all those languages will be automatically available and can be enabled from the .conf file of the application. Each JAR in NetBeans IDE has an equivalent JAR in all of the above languages, containing the translations for the English JAR they relate to.

However, what about other languages, e.g., German, French, Arabic, etc? Well, the good news is that the AgroSense team has published the old community translations (which were worked on until NetBeans IDE 7, with investigations still being done about how to continue that project) to Maven Central. The fact that nothing has been translated since NetBeans IDE 7 is not a problem if you're creating a NetBeans Platform application, since not much (if any) UI has been added to the NetBeans Platform since that time, i.e., most changes have been on the level of API changes and performance enhancements and, of course, in the application layer above it, for NetBeans IDE. The latter, though, is a layer that is completely irrelevant if you're interested in providing your own business application on top of the NetBeans Platform.

Include this in your NetBeans Platform application POM and add "--locale de" (or -J-Duser.language=de) to the .conf file of the application and your application will be German:

<dependency>
 <groupId>nl.cloudfarming.client</groupId>
 <artifactId>lib-platform-l10n</artifactId>
 <version>1.0-NB72</version>
</dependency>

Better still, here is a Maven application I created today that (1) includes the above dependency and (2) includes the .conf file in the right place:

http://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.3/misc/MyCoolApp

The screenshot you see above shows you all the JARs that will be downloaded, via the dependency shown above, just for one of the English JARs, so there'll be many other JARs for all the other JARs too.

Here's how NetBeans Platform 7.3 looks in German:

And here it is in French:

And here in Dutch:

When you are using Ant, instead of Maven, you can include all the translation JARs in your branding module:

http://java.net/projects/nb-library-wrappers/sources/core/show/lib-platform-l10n/nb72_platform_l10n/platform

Thanks Timon and the AgroSense project for making these translations available. 

Comments:

Is there an easy way to add missing word in the translation packages. In case of the german package the translation of the properties window title is missing.

Posted by Andreas on February 26, 2013 at 06:43 AM PST #

1. Right-click the branding module, e.g., in the case of the sample application it is called "MyCoolApp-branding".
2. Choose "Branding..." menu item.
3. In the Branding dialog, go to the Resource Bundles tab. This tab may take a while to load because it needs to display all the properties files in the NetBeans Platform.
4. Search for the string you want to change, e.g., "No Properties". The content of the tab is now filtered to display only the strings that match your query.
5. Right-click on a string and choose "Add to Branding". Now type in your translation and click OK. You'll see the translated string displayed.
6. Click OK and exit the Branding dialog.
7. Switch to the Files window and browse in "MyCoolApp-branding" to src/main/nbm-branding and you'll find properties files in the same places as where they're found in the JARs in the NetBeans Platform, overriding the equivalent strings with your own.
8. Run the application again and see the translated string.

Posted by Geertjan on February 26, 2013 at 07:10 AM PST #

Actually, there's another step. Step 7a. Once you've found the properties file that contains the string you've changed, right-click that file and choose Customize. Use the Customizer Dialog to add the locale for which you're creating the application, e.g., "de". That will create a new properties file, e.g., Bundle_de.properties. Make sure that this file contains your translated string.

Posted by Geertjan on February 26, 2013 at 07:40 AM PST #

And Step 7b: make sure the .conf file has the --branding flag set, e.g.:

default_options="--branding mycoolapp -J-Duser.language=de --laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel -J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Dsun.awt.disableMixing=true"

Posted by Geertjan on February 26, 2013 at 07:48 AM PST #

I updated the sample to make all the above changes, as an example. You should now see this when you run the application:

https://blogs.oracle.com/geertjan/resource/ohne-eigenschaften.gif

Posted by Geertjan on February 26, 2013 at 08:00 AM PST #

How exactly do a I add those jars to my "branding module"?

Posted by guest on February 26, 2013 at 12:30 PM PST #

Got the 7.2 build with Italian included. Put --locale on the end - works a treat.
However, if I just use the platform without all the ide stuff and make a program based on that, the top menu comes up in Italian, but the about screen says it is en_GB, not italian, even though the splash screen starts in italian.
What am I missing?

Posted by David Irving on March 22, 2013 at 08:15 AM PDT #

Could there be a bug in Netbeans concering the generated jar file. The properties files inside the localization jars follow the naming convention Bundle_de_${app.name}.properties. But shouldn't it be Bundle_${app.name}_de.properties. So the german translation is never used in Netbeans 7.3.

Posted by guest on May 31, 2013 at 06:41 AM PDT #

Look at the screenshots above. One of them is very clearly German...

Posted by Geertjan on May 31, 2013 at 07:15 AM PDT #

Oh, sorry! I was talking about the branding jars that where generated during the building process of a netbeans platform application (Comment #2 and #3). These were located in the ${app.name}/${app.name}/modules/locale folder of a netbeans platform application.

Posted by guest on May 31, 2013 at 07:23 AM PDT #

So your question has nothing to do with this blog entry. Why not write to the mailing list and ask your questions there? It's dev@platform.netbeans.org and the NetBeans Platform Learning Trail will tell you more about where to find it.

Posted by Geertjan on May 31, 2013 at 02:24 PM PDT #

That's right. Is there any workaround this problem ?

Posted by guest on November 27, 2013 at 08:19 AM PST #

hi
i download mycoolapp but not working.
i download the jar of Arabic but i don't know where to locate the jar files and how to use them.
thanks

Posted by guest on February 06, 2014 at 12:55 AM PST #

hi
i test German and Spain its work but in Arabic language is not appear as English Language is not work.
help me, please

Posted by guest on February 06, 2014 at 02:03 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today