• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

fmt:setBundle usage for internationalization

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i'm trying to use internationalization in my application.
for this, i have 2 properties files(one for us and other for french)

when i use the below tag(<fmt:bundle>), ApplicationProperties_fr_CA.properties file should be called.
But it is not picking that,instead it is invoking ApplicationProperties.properties file
please let me know what to do.

<fmt:setLocale value="fr_CA"/>
<fmt:bundle basename="com.gmac.dsr.config.i18n.ApplicationProperties"/>

Thanks in adv.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Where did you put your property files ?
2. How did you get the messages ?
 
nizams uddin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
property files are under one of my folder.
but the problem is that it is not setting locale to pick the right property file.
if i use
<fmt:bundle basename="com.gmac.dsr.config.i18n.ApplicationProperties_en_CA"/> directly, then it works.
but i want to set locale using fmt:setLocale tag.

please let me know at the earliest.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
en_CA ? You were talking about fr_CA ;) Are you sure you're using the correct extension ?

setLocale should work ok, because the container will add the extension to the basename set in fmt:bundle.
 
nizams uddin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is en_CA.
but main stuff is that it should pick the file.
or is there any other settings that i had to do.
any idea how to know the locale that is being set to.
for ex,<fmt:setLocale value="fr_CA"/> sets locale to fr_CA.
but how to retrive that set value so that i could check the locale.
i tried request.getLocale() and it gave en_US.
i think it is not setting and taking en_US which is a default value.

any suggestions guys how to proceed fwd.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've done a little test with fr_CA and it worked fine.
Where did you put your message files ?
 
nizams uddin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i inserted my property files under i18 folder of my framework.
we are supposed to put these files under this folder.
anyways it is picking ApplicationProperties_en_CA file if i manually type <fmt:bundle basename="com.gmac.dsr.config.i18n.ApplicationProperties_en_CA"/> instead of
<fmt:setLocale value="en_CA"/>
<fmt:bundle basename="com.gmac.dsr.config.i18n.ApplicationProperties"/>
so it is confirm that it is picking the file.
but main thing is the locale setting.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you are saying that <fmt:setLocale value="en_CA"/> does not allow you to read ApplicationProperties_en_CA.properties ?

 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic