wanjidong / jmesa

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

English resources bundle messages are not available in JMesa #201

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Have your JVM with default locale set to French for example (something
different than english US/EN)
2. Create a TableFacade and force WebContext Locale to Locale.US
3. Render the table, the messages are in french

What is the expected output? What do you see instead?
The messages in the table are expected to be in english US, not in french.

What version of the product are you using? On what operating system?
2.4.2 and 2.4.3. On Linux/Windows

Please provide any additional information below.
There is no resourcesBundle for en_US and en_EN.
If you look at
http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html#getBundle(
java.lang.String,%20java.util.Locale),
the default Locale is used before the resourceBundle with no Locale. So in
this case, if the default is French, and the webContext's Locale is US, it
will always get the French one because it doesn't find the US one.

To Fix this issue :
Create a 
org/jmesa/core/message/resource/jmesaResourceBundle_en_US.properties
and
org/jmesa/core/message/resource/jmesaResourceBundle_en_EN.properties

Original issue reported on code.google.com by vbere...@gmail.com on 23 Jun 2009 at 1:08

GoogleCodeExporter commented 8 years ago
Good point! I will be sure to do this. What is the en_EN? I think we would just 
need
en_US.

If you want I could even do this and make a build for you. If that sounds good 
just
email me at jeff.johnston.mn@gmail.com.

Original comment by jeff.johnston.mn@gmail.com on 24 Jun 2009 at 3:33

GoogleCodeExporter commented 8 years ago
Hi,
en_EN is english for England whereas en_US is english for US.
The better solution is to create a
org/jmesa/core/message/resource/jmesaResourceBundle_en.properties if there is no
differences between english and american.
No need for a special release thanks :)
I've added the file to my application classpath and it is working fine for now.
Thanks.

Original comment by vbere...@gmail.com on 24 Jun 2009 at 7:13

GoogleCodeExporter commented 8 years ago
I have the changes applied to the trunk!

Original comment by jeff.johnston.mn@gmail.com on 3 Jul 2009 at 4:00

GoogleCodeExporter commented 8 years ago
Hi,

Have tested 2.4.4 and this problem still occurs if the WebContext's locale is 
some
other English locale other than en_US (e.g. "en_AU", or even generic "en"). I 
would
agree with @vberetti's suggestion of renaming the file to just
jmesaResourceBundle_en.properties, as this will be matched by all English 
locales:
en, en_US, en_AU, etc.

Also, a technique that I've used in the past is to put the default messages in 
the
base file NAME.properties, and then create an empty file NAME_en.properties 
(well,
empty except for a comment explaining why it is empty!). Because the messages 
are not
found in NAME_en.properties, they will be taken from the base file instead, thus
avoiding redundancy.

Original comment by todd.m.o...@gmail.com on 4 Sep 2009 at 4:09