Tuesday, September 27, 2011

i18n - Creating Property files

In order to support multiple language(internationalization), it is required to have separate label property files for each of the supported language in the application. Here I have detailed how you can create the property file for an additional language.
· Copy the contents of the english property file to an excel sheet.
· Have key and English label in two different columns.
· Add a new column for Japanese label
· Send this excel sheet to customer and ask them to fill in the Japanese label column with the Japanese equivalent for each English label. Customer would be happy to type the labels in an Excel sheet than in any other format.
· Once you receive the updated sheet from the customer remove the English label column.
· Add an equal to (=) symbol between the key and Japanese label columns. Add a new column in the sheet for this.
· Now save this sheet as Unicode Text. Select this as the file type in the Save As popup in Excel sheet.
· Now close excel sheet, open the file in Notepad++ and examine the file. Please make any corrections if you find any and save. (You will be seeing other language text as squares when you open it in notepad++). Change the encoding type to UTF-8 from the Format menu before saving.
· Open command prompt.
· Execute the command native2ascii to convert the native characters to Unicode characters. Eg: native2ascii -encoding UTF-8 propertyfile.txt propertyfile.properties. (please set the path to jdk/bin folder if you are unable to locate the command native2ascii.
· The generated file will contain the Unicode characters and you can directly use it in the application for supporting Japanese language.

Labels:


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]