Solving the I18N problem has three classic ideas, the first is to provide each language related pages for each page. The second is to separate the content from the form of expression, and do content files of different languages. The third is dynamically translated page content. The third is rare, and the machine translation technology is still difficult to meet people's expectations. The second is our commonly used Properties.
The premise of these three implementations is to get the language and encoding of the client wish to display. When using the Properties file, we don't need to manually understand Accept-Language from the customer request, because Java packages these work, as long as you provide the Properties file, and use the corresponding message tab in the page (JSTL and major Framework has supported), you can get the desired display.
In the framework of Struts, you are used to using the Properties file to solve the I18n problem. In a project in my present, I use different JS files to solve this problem, I found it is not bad. I wrote a series of JS files: ** _ zh_cn.js, **. JS server output code, such as user_not_found. Select different JS files according to the version of IE or customer settings. One question is that you can't put all your confidence in a JS file, which will cause the JS file too much.
The idea of the landlord can be said to be a combination of one and two, separating the content, but not put it in the Properties, put it in the JS file, which is equivalent to providing each page with a JS file for each language.
I have always felt that all content information of the entire website is not a good habit in a Properties, which will look very bloated, complicated, so the way the landlord is compared. Moreover, the decision shows that the work of the language is moved from the server to the client, reducing the consumption of server-end resources, and changing the JS file page display can be embodied immediately without considering resource reloading issues. The only shortcomings are currently not good tool support.