|Kongregate Registration for Free Flash Games and Chat with solprovider|
Initial Language for Visitors
The homepage defaults to the default language of a publication. The following is about changing the homepage to use the browser's language. Any multi-language website should provide the ability to change languages. This code is a hack because the website I am building has only 2 languages; later are suggestions for creating a more generic solution, but Cocoon does not make it easy.
To control the initial language
Repeat the map:when clauses for each locale. If some locales include the country, you would need to specify each separately using the second example. Replace the final "index_en.html" with your default language.
A (better) universal solution would extract the language code from request:locale, then resource-exists check the correct index_xx.xml, and either redirect to it (if it exists), or use the default language (if not). The code would look like this:
THIS CODE DOES NOT WORK!