That is the translation system covered in a very broad manner, through the choices to implementation, extraction and testing. The extraction tool can also find and extract strings from PHP libraries or any source that has been appropriately marked up so you could make your entire application stack multi-lingual.
Of course there is one aspect so far avoided; namely the question of where do you allow the end-user to select their language and how to pass this information around?
Well there are various methods. Scorpio does have a distributor plugin for resolving the locale during distributor start-up. The supported methods are:
Which you chose is up to you and is definitely something you should consider as you build your application. While Scorpio does allow for site.com/LANG/... it is not properly supported (at the time of writing) and a better option would be to use sub-domains for each language and set the default language to the required language.
The ideal preference (if not sub-domains) is to offer language preference either via a cookie (long term storage) or as a sign-up preference to a user record so it can be loaded into the session.
A few other notes:
In the translations you should always supply one that is the same as that included in the template - this ensures that there is always a default and - more importantly - allows for the default to be updated without having to change the templates.
Using the Smarty compile and cache ids per language generates a LOT of cache data. Be sure that there is sufficient disk space for each language cache.
Remember that translation should not be seen as a "bolt-on" to the site - you should make every effort to design it in from the start. It can take a long time to get text translated (e.g. from a bureau) and you will need the staff to support queries in those languages you add.
Finally: please feel free to leave comments and suggestions in the comments or contact the project via the methods on the contact page.
Posted by: Dave Redfern (Writer), in Tutorials on 07 Sep 2009 @ 22:54
Tags: languages, translation system, tutorial,
Contents:
This
work is licenced under a
Creative Commons Licence.