fbordina / pwm

Automatically exported from code.google.com/p/pwm
0 stars 0 forks source link

Patch for /trunk/pwm/servlet/src/password/pwm/i18n/LocaleHelper.java #410

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is a small bug in the retrieval of Custom Localized Messages. Currently 
getLocalizedMessage always returns the default messages from the 
Message_x.properties files. Custom Localized Messages are not retrieved from 
the PwmConfiguration.xml.

Original issue reported on code.google.com by sebastia...@gmail.com on 25 Jun 2013 at 1:06

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The attached patch was incorrect. It seems that the call to getMessageBundle 
does not take any values into account that are customized in 
PwmConfiguration.xml.

I'm not sure why Display items are read from the config first, and with no 
match the the getMessageBundle gets called to get the Message items.

Probably this code could be replaced by a single call to readLocalizedBundle? 

Original comment by sebastia...@gmail.com on 25 Jun 2013 at 2:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Attached a proposed patch. This fixes the issue with not reading the custom 
Localized Messages. Note that with this patch the value replacements are also 
done when bundleClass.getName() != Display.class.getName() (i.e. 
Message.class.getName()). I'm not too familiar with the rest of the code if 
this has impact or not (functionality and/ or performance).

I've done some testing and it seems to be working OK.

Original comment by sebastia...@gmail.com on 25 Jun 2013 at 3:36

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch and debugging, this was incorrect indeed.  Patched in 
revision 576.

Original comment by jrivard on 30 Jun 2013 at 7:37

GoogleCodeExporter commented 9 years ago
You're welcome. Thanks for accepting the fix in such a short time :)

Original comment by sebastia...@gmail.com on 2 Jul 2013 at 6:53