Eddy Young wrote:
Quoting Geert Bevin <[EMAIL PROTECTED]>:
Even if i18n is mainly an element's responsability, i like the
idea to be able to get some very specific resource at template
level with sth like "[!V 'L10N:bundlename:key"
Glad to see someone else supporting my views about the convenience of
specifying the resource bundle in the templates. Of course, this should be
kept to a minimum.
After posting the reply, I realised that is not necessarily the best way
to implement L10N in RIFE as it will defeat the purpose of a web
framework, which is to make development hassle-free, and the goals that
Geert has for the project.
Now, my opinion is that the templating system should remain true to its
origins and not contain any logic, not even for L10N.
A good approach, I think, would be to let the developer declare the
resource bundle basename as a property that gets IoC'ed in the
participants/elements and let RIFE identify the locale by referring to
the "Accept-language" header. However, to allow flexibility, there
should be an addition to Element to allow the user to override the
locale that has been determined by RIFE already (for example, setLocale()).
This would keep things simple. For example, localising an application
would be a matter of setting the resource bundle basename in one of the
XML files, either at site or element level, then using the existing [!V
'L10N:key'/] tag in the template -- no change there.
For other internationalisation tasks such as formatting dates and
currencies, this should be taken care of by the existing constraints
mechanism for date validation and formatting.
This makes it as simple as in the current <fmt:message key="key" /> JSP
implementation which, IMHO, is the simplest implementation of
localisation I've ever found.
In short, localisation should be as simple as:
1) write a .properties file following the existing naming scheme
2) specify the basename in the XML
3) use the [!V 'L10N:key'/] tag in the template
Regards,
Eddy
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users