TaT NewLocalePropertiesNB65

Revision as of 16:44, 5 November 2009 by Admin (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Create new locale properties files with NetBeans

Contributed by: Hubert A Klein Ikkink


Reposted from this blog entry: http://mrhaki.blogspot.com/2009/05/create-new-locale-properties-files-with.html

Tips and Tricks

Developing an application with localized messages is something I need to do now and then. Most of the time the messages are defined in a properties file. For each locale we need to create a properties files with the messages. For example if we have a main properties file messages.properties and we want to define messages for the locale nl we must create the file messages_nl.properties. NetBeans supports this scenario with simple commands to quickly create new properties files for different locales.

Suppose we have created a main locale properties file messages.properties. We right-click on the file and select Add | Locale... from the pop-up menu:

File:locale_TaT_NewLocalePropertiesNB65.png

NetBeans opens a new dialog window. Here we can select a locale from the list of locales or fill in the correct values ourselves.

File:locale2_TaT_NewLocalePropertiesNB65.png

When we click the OK button we have a new messages_nl_NL.properties file. In our Project Navigator we can see the new locale as node for the messages.properties file:

File:locale3_TaT_NewLocalePropertiesNB65.png

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo