I totally agree with this approach Eddy and it's very close to what
Raoul has already done. The only difference is that I think that the
Locale setting should be replaced by a mechanism to retrieve a list
of locales (LocaleProvider).
On 2-dec-05, at 14:11, Eddy Young wrote:
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
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users
--
Geert Bevin Uwyn bvba
"Use what you need" Avenue de Scailmont 34
http://www.uwyn.com 7170 Manage, Belgium
gbevin[remove] at uwyn dot com Tel +32 64 84 80 03
PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users