Thursday, September 14, 2006

In my language please

One thing I find EPiServer does really well is their multi-lingual interface. Basically all text used in the UI is stored in a number of XML files inside the website, each identified with a language code. With a standard installation you get a number of languages out of the box, one of which is English.

Today at work a colleague of mine was finding that the system dates being displayed were in American format and was wondering how to display them in our local format. He had selected "English" as his system default, but this didn't seem to make a difference.

With the default English selection, American formats will be used. Adding a local English option is not only easy but important for a number of reasons. Some of the functions in EPiServer depend on the system language selection. One is the display of regional options such as dates, and another is the language dictionary used for the spell checker.

The language selection list is built dynamically from the list of available languages found in the "lang" installation folder. This makes it quite easy to add your own languages to the list, simply by adding new language files.

For example, to add a New Zealand language option you could do the following:
  1. Make a copy of "languageEN.xml" and call it "languageEN-NZ.xml"
  2. Open the new xml file and edit the name and id attributes on the language node.
  3. Set the name to "English NZ" and the id to "EN-NZ" (the id needs to match an official language code).
  4. Set your system default language in admin mode or user preferred language in edit mode.
  5. Optionally update the language files to your local spelling ;)
  6. One last thing is to check any other language files in the "lang" folder, in case you need to add a language code to them too. One standard file is the "workflow.xml" which will require you to create a set of translations with your new language code.
This is one of the many reasons I really like working with the EPiServer product. Because of features like this you can give your end users a much better experience, without spending a lot of your own time customising.

No comments: