[jboss-user] Re: SEAM internationalization problem :(

samk at twinix.com samk at twinix.com
Mon Feb 9 06:27:40 EST 2009


See Thread at: http://www.techienuggets.com/Detail?tx=11263 Posted on behalf of a User

hi everyone,
                i am new to seam framework.i don't know the procedure to internationalization an application.can any body tell the procedure how to do this ans specify the information regarding in which files i have to specify the informaion.



thanks in advance

In Response To: 

Hi guys,

I'm having a problem with internationalization in SEAM for 2 days now. And I can't seem to make it right. So, I have the following files:

pmResources_ro.properties
pmResources_en.properties
pmResources_fr.properties
pmResources.properties

They are stored in:
/myapp.ear/myapp.war/WEB-INF/classes/

Here is what faces-config.xml contains about the bundle:
<application>
  |         <message-bundle>pmResources</message-bundle>
  | 	<locale-config>
  | 		<default-locale>ro</default-locale>
  | 		<supported-locale>ro</supported-locale>
  | 		<supported-locale>en</supported-locale>
  | 		<supported-locale>fr</supported-locale>
  | 	</locale-config>
  | </application>

The components.xml part:
<core:resource-bundle>
  | 	<core:bundle-names>
  | 		<value>pmResources</value>      
  | 	</core:bundle-names>
  | </core:resource-bundle>

And in my page I use it with:
...
  | <f:loadBundle basename="pmResources" var="bundle"/>
  | ...
  | <h:outputText value="Text=#{bundle.AboutUsText}"/>

Even though ro should be default, every time I load the page en is the one displayed. And I tried to use:
<h:selectOneMenu value="#{localeSelector.language}">
  |         <f:selectItem itemLabel="English" itemValue="en"/>
  |         <f:selectItem itemLabel="Francais" itemValue="fr"/>
  |         <f:selectItem itemLabel="Romana" itemValue="ro"/>
  | </h:selectOneMenu>
  | <s:button action="#{localeSelector.select}" value="ChangeLanguage"/>

>From what I know, JSF searches the properties files in the following order:
pmResources_ro.properties
pmResources_ro_RO.properties
pmResources_en.properties
pmResources_en_US.properties
pmResources_fr.properties
pmResources_fr_FR.properties
pmResources.properties

Can anyone help me with this ? Thanks in advance!





More information about the jboss-user mailing list