This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm facing a problem where i have to internationalize a web service.
I have x number of .jsp files, where i present for example:
"Enter your surname:"
"Enter your e-mail".. and so on.
And i wonder if there is any simple way to change language by for example clicking a button.
The krux is that i have to use the same file, so I'm thinking, maybe there is a way to have 2 files with properties, same name of the properties
but the value is on 2 different language, and then when you click the button you simply read the properties from one file or the other?
Is this possible, if so, how do i implement it? :-)
You may have two different property files to be served based on the language change. The same behavior is being followed in frameworks like struts. It would not be a recommendation to use same file for different language.
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Joined: Nov 18, 2008
Kumaravadivel Subramani wrote:You may have two different property files to be served based on the language change. The same behavior is being followed in frameworks like struts. It would not be a recommendation to use same file for different language.
I found a solution using propertyfiles.
I fixed the language problem, but one issue still remains. Now when i change the language using JSTL it changes for the webpage that i'm on. How can i make the language selection to be implementet on every page, when i brows to other pages on the same site?
I guess there must be some kind of way to send a value between pages and when the next page is about to load, checks "what language?".