Hi
I build an internationalized web site with struts... it works great.
My problem is that i think it is not practical to use <bean:message ...> for large text pages (like "Terms of Use" page) - think of the problematic text value size of the attribute in the properties file...
So i build a "wrapper jsp" that include the correct html according to the user language, here it is:
//suppose i have terms_en.html, terms_ru.html, terms_iw.html files...
<%@ page contentType="text/html;charset=UTF-8" import="java.util.Locale,org.apache.struts.Globals" %>
<% String p=request.getParameter("page"); //page=terms
String lang=((Locale)session.getAttribute(Globals.LOCALE_KEY)).getLanguage();
String path="/"+p+"_"+lang+".html";
%>
<html:html locale="true">
<head>
<html:base />
<META http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body dir="<bean:message key="dir" />">
...
<jsp:include page="<%=path%>" flush="false" />
...
</body>
</html:html>
Now, it works just fine with
english and my
default locale, i.e the locale defined in the "Regional Settings" at the control panel.
other languages are displayed
incorrectly and if i want to see a language correctly then i have to change the default locale in the "Regional Settings" at the control panel.
Is there any way to solve my problem?
I'm ready to hear any suggestions... if you have other way than include...
thanks A LOT
Mamtz