Home : OpenEdit SDK : Programming OpenEdit : Multiple Language Support
Multiple Language Support
OpenEdit comes with a translation administration screen. This allows you to get a view of all the links in your site and the last date they where modified. You can see from the list when an english page has been updated to make sure each language page has also been updated since that date. The icon will turn green once the translated page has a newer modification than the base page. You can click on the pencil to edit the page. If a page has never been translated and does not exist it will load up the english page then when you save it it will be saved in the correct directory for that language.
Setting Up The Files
Add these tags to your /_site.xconf file:<property name="languages">
<value>English</value>
<value locale="es">Spanish</value>
<value locale="cn">Chinese</value>
</property>
<property name="languages_es">
<value>Ingles</value>
<value locale="es">Espanol</value>
<value locale="cn">Chino</value>
</property>
This will give the administrator user a list of languages that are setup on the site. The administrator can switch from one language to another.
Change Language
You can add a locale property to an editor from within the Account Manager interface.Or you can create set a session variable named sessionlocale You can copy this html code: /base/openedit/translations/changelanguage.html to use a drop down.
Finally the editor will save files to the language as selected by their browser. In Firefox go to Edit | Preferences | Advanced | Edit Languages. The server will use the top most languages.
File Encoding
OpenEdit supports UTF-8 and other standard Java encodings. To check your encoding you can view your /_site.xconf file for this property:<property name="encoding">UTF-8</property>
If you are doing a bunch of copy and pasting from Windows you might want to change the default encoding to:
<property name="encoding">ISO-8859-1</property>
