-
Notifications
You must be signed in to change notification settings - Fork 49
Localization
Site localisation can be implemented several ways... First of all, it seems quite attracting to create for each language a workspace.
This approach is quite easy to implement, but has some serious disadvantages:
- First of all: it is not possible to 'link' the translations of nodes to eachother:
- Secondly, it is not possible to have 'common' templates, css resources etc.
- Menu structures have to defined over and over again in each workspace/language
Another approach is one workspace with one 'root' node for each language and a few common nodes for shared resources such as templates (includes), css resources, images, etc.
- Create a tile that redirects http://host/ to http://host/nl (depending on the locale)
- Create a tile that makes it possible to change the locale. (dropdown with supported locales)
This tile detects the current node and tries to find the translated node in the 'new' language.
This is done by replacing the language prefix: http://host/nl/index.html becomes http://host/ fr /index.html (So, now it is not yet possible to translate the name of the node itself: http://host/en/whoAmI.html cannot be translated to http://host/nl/wieBenIk.html
- Create an UriMapper? which sets the locale, depending on the used language prefix. (so entering the url http://host/nl/somepage.html sets immediately the locale.
- Menu titles should also be translated. Therefore I 'customized' the Menu plugin and added a property to add title translations for each language
I need to cleanup the code a bit. Once I'm ready with this, I'll make the sources available..