[Lift] Re: About the localization with lift:loc !

2009-11-10 Thread Neil.Lv
yk, But if only one person change the language ( to ms_MY). Then the other users of the website will also see the page as ms_MY language not the default language en_US. I test in my computer it will affect the other browsers. So... Cheers, Neil On Nov 10, 3:16 pm, YING-KWANG TU

[Lift] Re: About the localization with lift:loc !

2009-11-10 Thread Timothy Perrett
Don't call Locale.setDefault - that is a global configuration for the JVM I would urge you to re-read my article -in it you'll see how I take a note of the requested locale, and then hold that in a cookie for later reference or use on a future visit. Study the locale calculator carefully

[Lift] Re: About the localization with lift:loc !

2009-11-10 Thread Neil.Lv
Thanks Tim, we're looking forward to your detail reply! :) Cheers, Neil On Nov 10, 4:40 pm, Timothy Perrett timo...@getintheloop.eu wrote: Don't call Locale.setDefault - that is a global configuration for the JVM I would urge you to re-read my article -in it you'll see how I take a

[Lift] Re: About the localization with lift:loc !

2009-11-09 Thread Neil.Lv
Yeah, it get the same result . So I'm very confused with the lift:loc ... Is anyone know this problem ? Thanks for help. :) Cheers, Neil On Nov 9, 2:53 pm, YING-KWANG TU ying.kwang...@gmail.com wrote: Neil, Considering that we are both using the lift-core_xx_XX in our

[Lift] Re: About the localization with lift:loc !

2009-11-09 Thread YING-KWANG TU
Tim, You can browse to http://219.94.110.243 for the test site running on Ubuntu Server 9.10. There is a down-loadable test project which you can test out. Before this discussion thread on UTF-8 or ISO8859-1, 1. localization is running great on windows+maven2.2.1+liftweb1.1-M7 2. lift:loc

[Lift] Re: About the localization with lift:loc !

2009-11-09 Thread YING-KWANG TU
By adding a println line in my localeCalculator churned the following output: en_US en_us en_us en_us en_us INFO - Service request (GET) / took 53 Milliseconds en_us ms_my ms_my ms_my ms_my INFO - Service request (GET) / took 37 Milliseconds ms_my th_th th_th th_th th_th INFO - Service request

[Lift] Re: About the localization with lift:loc !

2009-11-09 Thread Neil.Lv
Maybe it's a bug with lift:loc locid=/ It's so confused. Cheers, Neil On Nov 10, 12:11 pm, YING-KWANG TU ying.kwang...@gmail.com wrote: By adding a println line in my localeCalculator churned the following output: en_US en_us en_us en_us en_us INFO - Service request

[Lift] Re: About the localization with lift:loc !

2009-11-08 Thread YING-KWANG TU
Neil, Considering that we are both using the lift-core_xx_XX in our bundle. 1. S.??(works seamlessly) However, I am having same issue with you on: lift:loc locid=loginDefault Value/lift:loc OR lift:loc loc_id=loginDefault Value/lift:loc OR lift:loclogin/lift:loc I am not sure if it has to

[Lift] Re: About the localization with lift:loc !

2009-11-07 Thread Timothy Perrett
You should always be working with UTF-8 files for properties / localisation - I think the encoding reported by jetty is something different (that it reads from the system)... ensure your props files are UTF-8 and go from there. Cheers, Tim On Nov 7, 12:48 am, yk ying.kwang...@gmail.com wrote:

[Lift] Re: About the localization with lift:loc !

2009-11-07 Thread Neil.Lv
yk, I use the code that you write. 1:) I use this link to test the i18n http://localhost:8080/?locale=ms_MY S.??(login) = it works well ! 2:) But this code in the html page, it always doesn't work too, just show the Default value lift:loc locid=loginDefault value/lift:loc

[Lift] Re: About the localization with lift:loc !

2009-11-07 Thread Jeppe Nejsum Madsen
Timothy Perrett timo...@getintheloop.eu writes: You should always be working with UTF-8 files for properties / localisation - I think the encoding reported by jetty is something different (that it reads from the system)... ensure your props files are UTF-8 and go from there. Careful now :-)

[Lift] Re: About the localization with lift:loc !

2009-11-04 Thread yk
Neil, 1. I've copied life-core_en_US.properties from lift-webkit.jar to src/ main/resources/i18n like u did n renamed to life- core_ms_MY.properties. 2. I've changed the login=Login (BM) for in file life- core_ms_MY.properties for testing 3. I am able to test localization on the fly successfully

[Lift] Re: About the localization with lift:loc !

2009-11-04 Thread YING-KWANG TU
Neil, 1. I've tried creating life-core_th_TH.utf-8 by copying from life-core_en_US.properties file. 2. Open the th_TH file in notepad and overwritten as UTF-8 3. I've copied some thai characters from the internet and replaced login=ที่อยู่ปัจจุบัน and saved. 3. native2ascii comes with java, so I

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Timothy Perrett
Neil, Can you zip and send me an example? It's quite likley your missing something and without seeing the code it's difficult to say. Cheers, Tim Sent from my iPhone On 26 Oct 2009, at 03:54, Neil.Lv anim...@gmail.com wrote: in the /index.html ### both of them are not work !

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Neil.Lv
1:) I create a file in the i18n folder /src/main/resources/i18n/lift-core_zh_CN.properties . login = \u767b\u5f55 logout = \u9000\u51fa log.in = \u767b\u5f55 log.out = \u9000\u51fa sign.up = \u6ce8\u518c logged.in = \u5df2\u7ecf\u767b\u5f55 .. the others are default (copy from

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Timothy Perrett
Hmm - you posted a link to my article at the begining of this thread; in that article I explain lifts locale calculator. Without this, Lift has no idea how you want to handle different locales. By default, the following is used: var localeCalculator: Box[HTTPRequest] = Locale =

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Neil.Lv
tryo(r.getParameter(locale)) match { case Full(null) = workOutLocale case Empty = workOutLocale case Failure(_,_,_) = workOutLocale case Full(selectedLocale) = { setLocale(selectedLocale) selectedLocale } } In this code , what's the tryo ? is try ? tryo ()

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Neil.Lv
lift:loc locid=loginLog in 222/lift:loc That means this code is correctly, the problem is that the browser doesn't know the locale? So we need to calculate the locale in the Boot.scala file ? Cheers, Neil On Oct 26, 5:09 pm, Neil.Lv anim...@gmail.com wrote:

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Timothy Perrett
Yes, your template code is right - your just seeing the default value because you have not told lift what resources to use when it gets the locale header from the browser. tryo() is like try/catch however, it will catch exceptions and returns Box[T] I would really suggest starting with

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Neil.Lv
I have a silly question , where is the setLocale method ? I don't know where the package located. src\main\scala\bootstrap\liftweb\Boot.scala:63: error: not found: value setLocale setLocale(selectedLocale) :) Cheers, Neil On Oct 26, 5:50 pm, Timothy Perrett timo...@getintheloop.eu

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Timothy Perrett
setLocale was a method created by me, specific to my application - it does not exist in Lift... hence why I removed it in my simplified example. Cheers, Tim On 26 Oct 2009, at 11:45, Neil.Lv wrote: I have a silly question , where is the setLocale method ? I don't know where the

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Neil.Lv
... Where is the locale to be set that the browser can know the locale ? Thanks very much! Cheers, Neil On Oct 26, 7:50 pm, Timothy Perrett timo...@getintheloop.eu wrote: setLocale was a method created by me, specific to my application - it   does not exist in Lift... hence why I

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Timothy Perrett
The browser already knows the locale, you have it backward! Your localeCalculator is so that the browser can get lift to return the right content. Take a look at: http://scala-tools.org/mvnsites/liftweb-1.1-M6/lift-webkit/scaladocs/net/liftweb/http/provider/HTTPRequest.html I would start

[Lift] Re: About the localization with lift:loc !

2009-10-26 Thread Neil.Lv
I feel the information of this page is less for me, but Thanks all the same ! :) Cheers, Neil On Oct 26, 9:12 pm, Timothy Perrett timo...@getintheloop.eu wrote: The browser already knows the locale, you have it backward! Your   localeCalculator is so that the browser can get lift to

[Lift] Re: About the localization with lift:loc !

2009-10-25 Thread Neil.Lv
if i use this code and it works correctly ! Code: ### login = \u52a8\u4f5c ### But it's so difficult to write code ! I don't know what happens with it . Cheers, Neil On Oct 25, 7:19 am, David Pollak feeder.of.the.be...@gmail.com wrote: Please make sure your

[Lift] Re: About the localization with lift:loc !

2009-10-25 Thread Neil.Lv
Yeah, it's saved as U8-UNIX encoding by the Ultraedit. My IE's default language is zh_CN, but i get the same garbled in the browser. Like this in the browser. ### 555å Ž ### Cheers, Neil On Oct 25, 7:19 am, David Pollak feeder.of.the.be...@gmail.com wrote: Please make sure your

[Lift] Re: About the localization with lift:loc !

2009-10-25 Thread Jeppe Nejsum Madsen
David Pollak feeder.of.the.be...@gmail.com writes: Please make sure your lift-core_zh_CN.properties was saved as UTF-8 Unless, lift does it's own property loading, property files need to be in ISO-8859: When saving properties to a stream or loading them from a stream, the ISO 8859-1 character

[Lift] Re: About the localization with lift:loc !

2009-10-25 Thread Timothy Perrett
Neil, This is normal practice with java localisation - the best thing is do write all your strings then use native2ascii or similar tooling to convert it into the unicode representation. Glad you found my article helpful. Cheers, Tim On Oct 25, 5:02 am, Neil.Lv anim...@gmail.com wrote:    if

[Lift] Re: About the localization with lift:loc !

2009-10-25 Thread Neil.Lv
in the /index.html ### both of them are not work ! lift:loc locid=log.inLog in/lift:loc lift:loc id=log.inLog in/lift:loc ### Cheers, Neil On Oct 25, 6:27 pm, Timothy Perrett timo...@getintheloop.eu wrote: Neil, This is normal practice with java localisation - the best thing is do

[Lift] Re: About the localization with lift:loc !

2009-10-24 Thread David Pollak
Please make sure your lift-core_zh_CN.properties was saved as UTF-8 On Sat, Oct 24, 2009 at 11:31 AM, Neil.Lv anim...@gmail.com wrote: Hi all, I create a props file in the resources folder /src/main/resources/ i18n/lift-core_zh_CN.properties And i changed the log.in text value.