For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 2 replies, 2 voices, and was last updated 15 years, 11 months ago by
amir55.
-
AuthorPosts
-
hi all
1 – I can save Arabic and display as plain text but incase of changing Locale it does not not.
I use the utf-8 encoding for myeclipse and my page jsp.
I can display many locales from Germany to French fine
but when I add Arabic the windows shows gabage why?
I use .propeties files to support as resoursebundles.
I can read the internet Arabic sites fine so the brower is set to utf-8 too but in running the web application I do not get the Arabic scripts.
Do I have to do some encoding cnanging a part from myeclipse and web ,jsp file or what
All I want to make an Arabic site for myself using my fullversion myeclipse 8.5
many thanks
Amir
September 7, 2010 at 4:05 am #311153
support-shaliniMemberAmir,
Your issue is not clear to me. Can you send us some screen shots showing the issue? Also, can you list out the steps in detail to replicate your issue.September 7, 2010 at 12:37 pm #311169hi dear sir
My example is very simple but it has one bug that it does not show the Arabic text in spite of changing locale . It shows jargon of
1 – localeChanger.jsp which is simply 3 radio boxes for locale selection which would display the welcome word accordingly
<%@ page contentType=”text/html;charset=UTF-8″ language=”java” import=”java.util.*” pageEncoding=”UTF-8″%>
<%@ taglib uri=”http://java.sun.com/jsf/html” prefix=”h”%>
<%@ taglib uri=”http://java.sun.com/jsf/core” prefix=”f”%>
<html lang=”ar” dir=”rtl”>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<f:view locale=”#{localeChanger.locale}”>
<html>
<head> <title></title> </head>
<body bgcolor=”white”>
<h:form>
<h:panelGrid columns=”2″>
<f:facet name=”label”>
<h:outputText value=”#{labels.prefLangHeader}” />
</f:facet>
<h:outputText value=”Choose a language” /> <br/>
<h:selectOneRadio value=”#{localeChanger.locale}”>
<f:selectItem itemValue=”en” itemLabel=”English”/>
<f:selectItem itemValue=”de” itemLabel=”German”/>
<f:selectItem itemValue=”ar” itemLabel=”Arabic”/>
</h:selectOneRadio>
</h:panelGrid>
<h:commandButton value=”Submit” action=”#{localeChanger.changeLocale}” />
</h:form>
<h:outputText value=”#{message.welcome}” />
</body>
</html>
</f:view>2 – bean which only changes the locale
package internationlise;
import java.util.Locale;
import javax.faces.context.FacesContext;public class LocaleChanger {
private String locale ;public String getLocale() {return locale;}
public void setLocale(String locale) {this.locale = locale;}public String changeLocale (){
FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(getLocale()));;
return null;
}
}3 – faces-config.xml which shows the locales and the properties package
<?xml version=’1.0′ encoding=’UTF-8′?>
<faces-config xmlns=”http://java.sun.com/xml/ns/javaee”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd”
version=”1.2″><application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>de</supported-locale>
<supported-locale>ar</supported-locale>
</locale-config><resource-bundle>
<base-name>bundles.Messages</base-name>
<var>message</var>
</resource-bundle>
</application><managed-bean>
<managed-bean-name>localeChanger</managed-bean-name>
<managed-bean-class>internationlise.LocaleChanger</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean></faces-config>
4 -. properties which contains one word each of welcome
Messages.propertie welcome=Welcome
Messages_ar.properties welcome=شس شس
Messages_en.properties welcome=Welcome
Messages_de.properties welcome=Welcomeen5 – Notes :
1 – I use tha UTF-8 encoding in the jsp file as above
2 – Also in myeclipse from windows -> preferences -> general -> Content Types -> Text -. UTF-8
Also for jsp but here it restores the default value of ISO-8859-1 i.e does not save it why?
3 – I use windows XP professional supporting English and Arabic
4 – I changed the encoding in internet browser Tools as wellI do appreciate the solution ASAP
Amir
-
AuthorPosts

