I’m in the process of creating a web app in PHP which will be available in many different languages (about 10 in total), and I’d like to know what you view as best practice for setting this up in more general terms.
My idea is to keep all languages under the same domain, with a suffix such as “http://myservice.com/de”, where a script performs a location check upon site entering and redirects the user.
Editorial content will be shared between all languages as single posts in the database with a specific data column for each language.
Markup and scripts will all be documented in English, while pages and sections visible for the user will be translated into their respective language gathered from a common word library file.
A .htaccess file provides handling all rewrites for articles to display them in their appropriate language, i.e. “http://myservice.com/de/artikel/12345/” to “http://myservice.com/article?id=12345&lang=de”.
What do you consider to be a clean and efficient multi-lingual setup?
Everybody has different opinions about how best to go about setting up an internationally-friendly website. However, I try not to reinvent the wheel by making my own system. Rather, I use the built in internationalisation and localisation tools in frameworks such as CakePHP.
From the CakePHP book;
http://book.cakephp.org/1.3/view/1228/Internationalization-Localization
Using the built-in tools, for me, offers an efficient way to translate applications without URL rewrites. It also means that a user can configure their localisation preferences and have them automatically applied every time they log in.
Such a method will also be considered more search-engine friendly because you won’t get multilingual duplicates of the same content.
Hope this helps out.