hi,

A bit of multilanguage stuff...

Currently mmbase has the 'locale' and 'content' tag to set the locale, but as far as I know only the 'time' tag takes this locale into account. To develop multilanguage sites you probably will need to put a lot of the multilanguage content in the database/builders, but it might also be very useful to be able to put some locale-sensitive data in the jsp's.

I would like to do something like this.

<!-- get language and country from the request header
     or the parameters
-->
<mm:locale language="$language" country="$country">
  <mm:localized>
    <mm:part language="nl" country="NL">
      <!-- specific nl_NL content -->
      Hallo Wereld!
    </mm:part>
    <mm:part language="en">
      <!-- content for _all_ english speakers -->
      Hello World!
    </mm:part>
    <mm:part>
      <!-- fallback for the rest -->
      Hello to the rest of the World, we're sorry but your
      language is not supported, maybe you can read english?
    </mm:part>
  </mm:localized>
</mm:locale>

The 'localized' tag would express the same behaviour as the ResourceBundle class in java while selecting the best fitting option/part to display. I couldn't think of a good name to use for the tag that's now called 'part'.
I'm not really sure what's the best way to select the default locale, maybe just take the mmbase locale for that one instead of making it possible to specify one.


Is there already something like this, or another (better?) way to achieve the same behaviour? I could of course use resource bundles, but I'll need to use plain jsp to access those too don't I? Using 'compare' tags is not good enough since you won't have a good fallback mechanism.

groeten,

Simon



Reply via email to