Simon Groenewolt <[EMAIL PROTECTED]> wrote:
> 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.
Also <mm:fieldinfo type="gui..." /> uses it.
> I would like to do something like this.
> -->
> <mm:locale language="$language" country="$country">
> <mm:localized>
parts..
> </mm:localized>
> </mm:locale>
>
> 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?
Yes, e.g. the jsp-editors and cloud context security editors are doing just
that (the code is full of things like <%=m.getString("search.minage")%>
there).
Similar functionality is in the i18n taglib of jakarta IIRC (based on
resourcebundles), which was not used in jsp-editors to avoid the extra
depenency (and it is really simply in jsp).
The mechanism which you propose has advantages and disadvantages.
An advantage is that you can type the real text in the page, which is at the
same time a disadvantage if the translater is somebody else, or if the
number of languages is huge.
The other disadvantage is that it introduces more code to maintain which
has hardly to do with MMBase, which is less of a problem if a maintainer
volonteers (you?)
If I were to implement it, I would be inspired by ResourceBundles and
TreeInclude when deciding which language must be shown, and by linux'
'po/pot' mechanism for keeping texts clean, separated and in sync.
Michiel
--
Michiel Meeuwissen
Mediapark C101 Hilversum
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
[] ()