java - Muti language support in single web page -


I have a requirement that I have never experienced before. I have a web page in which I want to show the sentences of two languages. Like

How are you? (In English)
In a Spanish language

So far, I have used the concept of internationalization that will change the locale and change the entire web page (except for database driven values) In.

If the local language is set to Spanish, the entire form will be displayed in Spanish. The requirement here is that both the language string should be displayed next to each.

Update:
The image of my sample web page is here Enter image details here

Another way is to call it ResourceBundle and then moving it to locale , Iam Pass Dutch Locale and then you your resouces folder Resource files should be in my case, I have English, for messages_nl.properties messages.properties / code> for Dutch:

  locale default locale = new locale ("nl", "nl"); Resource Bundle ResourcesBandle = ResourceBundle.getBundle ("Message", Default Local);   

Then you can use the following stars:

  string greeting = resourceBundle.getString ("hello");   

So in your case you need to define the object of two resources, each of them in English and Spanish.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -