Hi Raoul,
thanks a lot for your proposal, there are quite a number of
interesting ideas in there.
It so happens that we discussed this on IRC 2 days ago:
http://servlet.uwyn.com/drone/log/bevinbot/rife/20051128 (check
around 17:05)
My proposal went into a similar direction, except instead of having a
'detect_client_locale' property, I was thinking of having a
'localeProvider' property. This would be an instance of a class that
implements the LocaleProvider interface and have one method:
List<Locale> getLocale(ElementSupport activeElement). RIFE could then
include a ClientLocaleProvider class that obtains the list of locales
that the browser provides as a suggestion. It also opens up the
possibility of any kind of possible locale negotiation.
This however requires an addition to the IoC injection support since
you should be able to easily add this to the site-structure without
having to provide it in a Participant.
What do you think, would this be a good alternative to your
'detect_client_locale' property?
Best regards,
Geert
On 1-dec-05, at 13:56, Raoul Pierre wrote:
Geert,
IMO, i18n is needed at the element level, not only at the template
level.
ATM only Crud Elements (others?) have access to a specific resource
bundle, two in fact with:
- l10n/admin files common to all the crud elements
- l10n/admin-name_of_the_element_class files
Proposition (see patches below, tested with java 1.5):
1/ make available parameters "detect_client_locale" and
"resourcesbundle_basename" in any element configuration file, i.e.
<element extends="authentication/memory.xml"
implementation="com.uwyn.ecalendar.authentication.elements.LocaleAuthe
nticated" >
<property name="resourcebundle_basename">l10n/authentication/
localization</property>
<property name="detect_client_locale">true</property>
</element>
2/ add getResourceName and getClientLocales functions to
ElementSupport (or in ElementContext? ElementInfo?):
3/ add a function getResourceBundles(List<String> basenames,
List<Locale> locales) to Localization
4/ give to TemplateFactory the list of client locales, via
ElementContext
5/ add to ElementSupport (or in ElementContext? ElementInfo?) the
support of resource bundle final list:
- add a mResourceBundleList variable
- add functions to deal with ResourceBundles
7/ update CrudElement
--
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
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users