It seems that Cocoon's I18N code is more geared towards internationalisation of 'webapps' rather than static sites.

It deals with menu items, etc, taking the various translations from catalog files, as necessary.

However, when you want to build a static site, where the entire content is in different languages, you need a way to pick the right file at the generator stage.

Therefore, I think we need an I18N input module. It would do something like:

<map:match pattern="**/*.html">
 <map:generate src="{1}/{i18n:{2}.{locale}.xml"/>
 ...
</map:match>

[NB. I'm not sure if nested input modules are allowed, so the syntax might need to change, but the idea should be sound]

So, here you can specify that, if the user requests userdocs/index.html, with a locale of de, you want to use userdocs/index.de.xml as your source file.

Two other areas that it should support:
(1) If the user specifies preferences in terms of locale, it should serve back the page most suiting their preference, e.g they might supply de, en, saying they prefer German, but English would be okay.
(2) If a translation in the user's language does not exist, it should offer a page in the 'default' language.


Does this make sense as a proposition?

If so, two questions:
(1) How best to represent the syntax of this, which will need to give access to values from matchers, and to the current locale
(2) What code in the I18N codebase could be reused to achive this?


For more info on where this came from see these threads on forrest-dev:
http://marc.theaimsgroup.com/?l=forrest-dev&m=107934498216665&w=2
http://marc.theaimsgroup.com/?l=forrest-dev&m=107935916929536&w=2
http://marc.theaimsgroup.com/?l=forrest-dev&m=107936342115987&w=2

Regards, Upayavira




Reply via email to