This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.
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.
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.
Joined: Jul 31, 2006
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.
I've done a little test with fr_CA and it worked fine. Where did you put your message files ?
Joined: Jul 31, 2006
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.