KonaKart Logo Documentation
Search
Internationalization of KonaKart

Internationalization of KonaKart

KonaKart is completely multi-lingual both at the database level and at the UI level.

Translating the KonaKart Admin Application

The data within the database such as product descriptions and category names etc. may exist in different languages. The database contains a languages table that contains information about each of the supported languages. When a new product is added to the database through the administration tool, it is possible to enter a description in multiple languages.

There is also a message catalog for each language. These can be found in the WEB-INF/classes directory of the application server. The default message catalog is called Messages.properties. This is defined as the default catalog in the struts-config.xml file in the WEB-INF directory using the following syntax:


<message-resources
	parameter="Messages"
	null="false" />

In order to change a language, the following steps must be taken (An example can be seen in the class SetLocaleAction.java):

Struts must be informed of the new language by calling the method setLocale() from within the Struts action. If Struts is passed a locale of en_GB, it looks for a message catalog called Messages_en_GB.properties. If it can’t find that, it looks for Messages_en.properties. If it cannot find that, it defaults to Messages.properties which was set as the default in the struts-config.xml file.

The KonaKart client engine must be informed of the new locale by calling the setLocale() method on it. This call configures the engine so that all subsequent calls will retrieve data from the KonaKart database in the appropriate language.

Translating the KonaKart Application

The KonaKart Administration Application can be completely translated simply by creating two message catalogues for your chosen language.

Whichever language you use this is also a handy way to re-label the "custom" fields that appear on many of the important objects within KonaKart to reflect the meaning in your particular system.

Your new message catalogs must be called:


// contains all the strings except the help page text 
AdminMessages_[language-code].properties     

// contains just the text on the help pages
AdminHelpMessages_[language-code].properties 

For [language_code] you should use the 2-character language code that you have set up in the languages section of the admin application. For example, you might have "fr" for French, "zh" for Chinese, "de" for German, "ja" for Japanese etc.

You should place your completed message catalogs in this directory:

webapps/konakartadmin/WEB-INF/classes

Since there are quite a large number of messages to translate, you might choose to do this over a period of time. A recommended approach is to start your new message catalogs with copies of the default (English) catalogs (called AdminMessages.properties and AdminHelpMessages.properties) then translate the messages that are most important to you first and complete the rest as time permits.

There are also a number of strings in the database that need to be translated. These are used by the Admin App to label some of the configuration parameters and provide helpful comments. If you issue a: "SELECT configuration_title, configuration_description FROM configuration;" SQL query, you will see the values that you can update.

Also, you may wish to include translations for the velocity templates (eg. EmailNewPassword, OrderDetails, OrderInvoice, OrderPackingList and OrderStatusChange).

Once you have completed the message catalogs, velocity templates and a sql update script for your language, please contribute these to the KonaKart Community by posting them to the contributions section of our forum for the benefit of other users.