Hi Pierre,
I cleaned up your patch quite a bit since you didn't really respect
the coding standard of the project. In the future, please try to
adhere to it very closely, I'm not sure I'll always be motivated to
go through all the files like this and adapt them. You also forgot
copyright statements, which I added. Please, also be careful when you
add Javadoc statements, add @since tags that refer to the next
release (1.4.1 now) and not to 1.0.
I committed everything to a separate branch since I think it needs
some more work. The branch can be found here:
https://svn.rifers.org/rife/branches/i18n
If you send me a login and password directly (not to the list), I'll
open up commit access to that branch for you.
I would be interested in the opinion of other users about these
functionalities, please let us know what you think about it and if
you have any suggestions.
Here are some things that need to be done imho:
* add Javadocs on every public method and class
* add a package-level Javadoc to the new i18n package and explain the
purpose and the architecture
* work on you existing Javadocs, since some don't explain very well
what goes on or are still in French and not in English
* add some comments in-line your code when you use an algorithm to
explain what the purpose is of each step (the StringUtils encode
stuff), don't say what the code does, explain it in a high level
* I'm not sure about the fixed property names and input names on
ElementSupport, it seems a bit hackish to me. I think it would be
better to inject an instance of TranslatorSupport. I know that RIFE's
IoC doesn't support the creation of references or invocation of
factories in-line yet in XML, but it will be added soon. Imho it
would be better to totally decouple the actual fact of having
properties or inputs from the base element support.
* For properties, I'm also trying to use plausible name for real
properties as much as possible. These will be injected into the
element instance if the setters are present and
setL10N_LOCALE_PROVIDER(String) doesn't look very nice.
* I'm not entirely sure about "boolean atTheEnd, boolean withDefault"
for the addResourceBundle methods either. We're trying to reduce
boolean flags as little as possible since without reading the
Javadocs, it's impossible to know what the method call does once it's
written. Do you think it's important to have these attributes
present? If so, can you give me an example why and preferably a
better API for achieving similar functionalities?
Best regards,
Geert
On 29-mrt-06, at 15:14, Raoul Pierre wrote:
Geert,
See herewith file.
Pierre
Hi Pierre,
can you please send the patches in a zip file, they get inline in
the message and I can't apply them.
Best regards,
Geert
On 28-mrt-06, at 15:06, Raoul Pierre wrote:
Hello,
Herewith, patch files for i18n.
To use request, user or required locales, put in config.xml the
parameter "I18N_FACTORY_IMPL" with value
"com.uwyn.rife.i18n.versatile.VersatileI18n" (by default Rife
behavior is as before).
Each element can specify a locale to be used in priority with
"L10N_REQUIRED_LANGUAGE" property (and if needed
"L10N_REQUIRED_COUNTRY")
Otherwise user locale is used if specified with
"L10N_USER_LANGUAGE" input (and if needed "L10N_USER_COUNTRY") .
If no required or user locale is specified, then the request
locales are used, if available.
Each element can have its own resource bundle: use
L10N_REQUIRED_RESOURCEBUNDLE property
Regards
Pierre
--
Geert Bevin Uwyn bvba GTalk:
[EMAIL PROTECTED]
"Use what you need" Avenue de Scailmont 34 Skype: gbevin
http://www.uwyn.com 7170 Manage, Belgium AIM: geertbevin
gbevin at uwyn dot com Tel: +32 64 84 80 03 Mobile: +32 477 302
599
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://lists.uwyn.com/mailman/listinfo/rife-users
<i18n_patch.zip>
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users
--
Geert Bevin Uwyn bvba GTalk: [EMAIL PROTECTED]
"Use what you need" Avenue de Scailmont 34 Skype: gbevin
http://www.uwyn.com 7170 Manage, Belgium AIM: geertbevin
gbevin at uwyn dot com Tel: +32 64 84 80 03 Mobile: +32 477 302 599
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://lists.uwyn.com/mailman/listinfo/rife-users