Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how container can access .properties file on the basis of client specific language

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

If i have clients from different geographical regions(for ex french, japanese) then my application will have MyApplication_french.properties, MyApplication_japanese.properties files when a french/japanese client access the welcome/index page there he can select the language in select box and clicks on the submit button based on this language parameter a particular application.properties is selected
1) how this process goes on and
2) is there anyother way of specifying languages in select box

thanks in advance
saiprasanna
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sai prasanna:
hi

If i have clients from different geographical regions(for ex french, japanese) then my application will have MyApplication_french.properties, MyApplication_japanese.properties files when a french/japanese client access the welcome/index page there he can select the language in select box and clicks on the submit button based on this language parameter a particular application.properties is selected
1) how this process goes on and
2) is there anyother way of specifying languages in select box

thanks in advance
saiprasanna


I am not sure, I understood your question correctly or not.

But there are two ways to give local language to user.

1. Get the language from browser, use ResourceBundle and change the content as per the language from the very first page (no need to give option to user to select the language)

2. Give an option to user to select the language and then change the content as per the language he/she selects.

What you want to implement?

If first one then get the locale/language from request (I think, getLocale()) and use ResourceBundle and...

If second then get the language from request parameter (whatever is the name of radio button etc) and do the rest of the things....

Are you looking for something else???
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Browsers send locale information in the user-agent header.

A Google Search with keywords "java i18n tutorial locale fmt JSTL|Struts" should get you started.
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks rathi & ben
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic