Re: T5: Chinese localization
Hi Nick, After I changed: from: configuration.add("tapestry.supported-locales", "zh,en"); to: configuration.add("tapestry.supported-locales", "en,zh"); from: persistentLocaleService.set(Locale.ENGLISH); to: persistentLocaleService.set(new Locale("en")); it works now, I don't know what's the difference, maybe they are just the same. but since it's working, I'll just leave it as it is now:) A.C. Nick Westgate wrote: > > I'm not sure without seeing your code. > What is top of the list in your browser's preferred languages? > > (In Firefox, Tools->Options->Advanced->Languages->Choose.) > > Cheers, > Nick. > > > - Original Message ----- > From: "Angelo Chen" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, 29 August 2007 10:35 p.m. > Subject: Re: T5: Chinese localization > > > > Hi Nick, > > You are right, the properties file has to be escaped, it works now, > thanks. > however I have observed some other problem: > > It always uses the app_zh.properties, even I do: > > persistentLocaleService.set(Locale.ENGLISH); > > the only time it will use the app.properties content is, when I delete the > app_zh.properties file, any idea why it's like that? > > Thanks, > > A.C. > > > Nick Westgate wrote: >> >> The question marks suggest the problem is on the Java (server) side. >> >> How are you encoding your Chinese characters in the properties files? >> You must escape them, which is easiest using an Eclipse plugin like: >> http://propedit.sourceforge.jp/index_en.html >> >> Cheers, >> Nick. >> >> >> Angelo Chen wrote: >>> Hi, >>> >>> I'm trying out Chinese localization, I have following: >>> >>> configuration.add("tapestry.supported-locales", "en,zh"); >>> >>> two files app.properties, app_zh.properites, both file has one entry: >>> >>> layout.home=Home >>> layout.home=主页 >>> >>> everything works in English, but when I switch: >>> >>> persistentLocaleService.set(Locale.SIMPLIFIED_CHINESE); >>> >>> what displays are questions marks. if I put English in the app_zh, it >>> can >>> display. the page is 'utf-8' and it displays utf-8 chinese correctly, >>> just >>> those strings coming out from app_zh, what I'm missing here? >>> >>> Thanks, >>> >>> A.C. >>> >>> >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- > View this message in context: > http://www.nabble.com/T5%3A-Chinese-localization-tf4347158.html#a12387250 > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-Chinese-localization-tf4347158.html#a12398083 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
I'm not sure without seeing your code. What is top of the list in your browser's preferred languages? (In Firefox, Tools->Options->Advanced->Languages->Choose.) Cheers, Nick. - Original Message - From: "Angelo Chen" <[EMAIL PROTECTED]> To: Sent: Wednesday, 29 August 2007 10:35 p.m. Subject: Re: T5: Chinese localization Hi Nick, You are right, the properties file has to be escaped, it works now, thanks. however I have observed some other problem: It always uses the app_zh.properties, even I do: persistentLocaleService.set(Locale.ENGLISH); the only time it will use the app.properties content is, when I delete the app_zh.properties file, any idea why it's like that? Thanks, A.C. Nick Westgate wrote: The question marks suggest the problem is on the Java (server) side. How are you encoding your Chinese characters in the properties files? You must escape them, which is easiest using an Eclipse plugin like: http://propedit.sourceforge.jp/index_en.html Cheers, Nick. Angelo Chen wrote: Hi, I'm trying out Chinese localization, I have following: configuration.add("tapestry.supported-locales", "en,zh"); two files app.properties, app_zh.properites, both file has one entry: layout.home=Home layout.home=主页 everything works in English, but when I switch: persistentLocaleService.set(Locale.SIMPLIFIED_CHINESE); what displays are questions marks. if I put English in the app_zh, it can display. the page is 'utf-8' and it displays utf-8 chinese correctly, just those strings coming out from app_zh, what I'm missing here? Thanks, A.C. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/T5%3A-Chinese-localization-tf4347158.html#a12387250 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
Hi Jun, yes, the property file is the problem. I have tried your site, it allows me to type chinese there. but I have some new problem now, it uses always app_zh.properties, can not switch to app.zh. A.C. Jun Tsai-2 wrote: > > 2007/8/29, Angelo Chen <[EMAIL PROTECTED]>: >> >> > > I think your properties is wrong.You can check out the simple chinse forum > based on T5. > > svn: http://lichen-forum.googlecode.com/svn/trunk/ demo: > http://www.middleware.cn/lichen > > -- View this message in context: http://www.nabble.com/T5%3A-Chinese-localization-tf4347158.html#a12387271 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
Hi Nick, You are right, the properties file has to be escaped, it works now, thanks. however I have observed some other problem: It always uses the app_zh.properties, even I do: persistentLocaleService.set(Locale.ENGLISH); the only time it will use the app.properties content is, when I delete the app_zh.properties file, any idea why it's like that? Thanks, A.C. Nick Westgate wrote: > > The question marks suggest the problem is on the Java (server) side. > > How are you encoding your Chinese characters in the properties files? > You must escape them, which is easiest using an Eclipse plugin like: > http://propedit.sourceforge.jp/index_en.html > > Cheers, > Nick. > > > Angelo Chen wrote: >> Hi, >> >> I'm trying out Chinese localization, I have following: >> >> configuration.add("tapestry.supported-locales", "en,zh"); >> >> two files app.properties, app_zh.properites, both file has one entry: >> >> layout.home=Home >> layout.home=主页 >> >> everything works in English, but when I switch: >> >> persistentLocaleService.set(Locale.SIMPLIFIED_CHINESE); >> >> what displays are questions marks. if I put English in the app_zh, it can >> display. the page is 'utf-8' and it displays utf-8 chinese correctly, >> just >> those strings coming out from app_zh, what I'm missing here? >> >> Thanks, >> >> A.C. >> >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-Chinese-localization-tf4347158.html#a12387250 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
2007/8/29, Angelo Chen <[EMAIL PROTECTED]>: > > > Hi Francois, > > I tried to modify the code, but > > requestGlobals.getHTTPServletRequest().setCharacterEncoding("UTF-8"); > configuration.add("Utf8Filter", utf8Filter); // handle UTF-8 > > setCharacterEncoding and utf8Filter can not be resolved. > > However I can put some Chinese in the template(utf8), all got displayed > correctly. > > A.C. I think your properties is wrong.You can check out the simple chinse forum based on T5. svn: http://lichen-forum.googlecode.com/svn/trunk/ demo: http://www.middleware.cn/lichen Francois Armand wrote: > > > > Angelo Chen wrote: > >> Hi, > >> > >> I'm trying out Chinese localization, I have following: > >> [...] > >> > > Have you tried this > http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding > > ? > > > > -- > > Francois Armand > > Etudes & Développements J2EE > > LINAGORA SA - http://www.linagora.com > > Tél.: +33 (0)1 58 18 68 28 > > --- > > InterLDAP - http://interldap.org > > FederID - http://www.federid.org/ > > Open Source identities management and federation > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/T5%3A-Chinese-localization-tf4347158.html#a12385851 > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- regards, Jun Tsai
Re: T5: Chinese localization
As I wrote before, your problem is most likely in your .properies encoding. Please re-read my previous email. Also carefully read the HowTo. T5.0.5 uses UTF-8 by default now, except for form submissions. If you are handling forms you still need to add the buildUtf8Filter() method, and also add the servelet jar since it accesses the HTTPServletRequest. Add this to your pom: javax.servlet servlet-api 2.4 provided Anyway, your original problem will remain, I suspect. Cheers, Nick. Angelo Chen wrote: Hi Francois, I tried to modify the code, but requestGlobals.getHTTPServletRequest().setCharacterEncoding("UTF-8"); configuration.add("Utf8Filter", utf8Filter); // handle UTF-8 setCharacterEncoding and utf8Filter can not be resolved. However I can put some Chinese in the template(utf8), all got displayed correctly. A.C. Francois Armand wrote: Angelo Chen wrote: Hi, I'm trying out Chinese localization, I have following: [...] Have you tried this http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding ? -- Francois Armand Etudes & Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
Hi Francois, I tried to modify the code, but requestGlobals.getHTTPServletRequest().setCharacterEncoding("UTF-8"); configuration.add("Utf8Filter", utf8Filter); // handle UTF-8 setCharacterEncoding and utf8Filter can not be resolved. However I can put some Chinese in the template(utf8), all got displayed correctly. A.C. Francois Armand wrote: > > Angelo Chen wrote: >> Hi, >> >> I'm trying out Chinese localization, I have following: >> [...] >> > Have you tried this http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding > ? > > -- > Francois Armand > Etudes & Développements J2EE > LINAGORA SA - http://www.linagora.com > Tél.: +33 (0)1 58 18 68 28 > --- > InterLDAP - http://interldap.org > FederID - http://www.federid.org/ > Open Source identities management and federation > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-Chinese-localization-tf4347158.html#a12385851 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
Angelo Chen wrote: Hi, I'm trying out Chinese localization, I have following: [...] Have you tried this http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding ? -- Francois Armand Etudes & Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
The question marks suggest the problem is on the Java (server) side. How are you encoding your Chinese characters in the properties files? You must escape them, which is easiest using an Eclipse plugin like: http://propedit.sourceforge.jp/index_en.html Cheers, Nick. Angelo Chen wrote: Hi, I'm trying out Chinese localization, I have following: configuration.add("tapestry.supported-locales", "en,zh"); two files app.properties, app_zh.properites, both file has one entry: layout.home=Home layout.home=主页 everything works in English, but when I switch: persistentLocaleService.set(Locale.SIMPLIFIED_CHINESE); what displays are questions marks. if I put English in the app_zh, it can display. the page is 'utf-8' and it displays utf-8 chinese correctly, just those strings coming out from app_zh, what I'm missing here? Thanks, A.C. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]