Discussion:
Localization for simplified and traditional chinese
Kit
2009-12-13 07:25:44 UTC
Permalink
i want to create an application which supports both simplified and
traditional chinese. so i created 2 strings.xml in values-zh-rCN (sim.
chi) and values-zh-rTW (tra. chi). but then i run the application in
the emulator, it seems that only the default strings.xml is loaded.

i tried to use values-zh as the strings.xml folder. it will be loaded
for both zh-CN and zh-TW locales. so is that i cannot add region code
for the strings.xml?

Thanks for your answer

Regards,
Kit
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
HeHe
2009-12-14 00:56:55 UTC
Permalink
not quite get your question.

selection of the resource folder should be automatic, as indicated in

android-sdk-windows/docs/guide/topics/resources/resources-
i18n.html

the current locale of your phone/emulator can be learned by

Locale.getDefault();

hope this helpful to you.
Post by Kit
i want to create an application which supports both simplified and
traditional chinese. so i created 2 strings.xml in values-zh-rCN (sim.
chi) and values-zh-rTW (tra. chi). but then i run the application in
the emulator, it seems that only the default strings.xml is loaded.
i tried to use values-zh as the strings.xml folder. it will be loaded
for both zh-CN and zh-TW locales. so is that i cannot add region code
for the strings.xml?
Thanks for your answer
Regards,
Kit
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Kit
2009-12-14 02:11:21 UTC
Permalink
Hi HeHe,

Thanks for your reply and sorry for the misleading. let me clarify my
question.

i didn't make any coding on localization. what it want to do is to let
my application shows either traditional chinese/simplified chinese
depending on the phone locale. currently i got the following two
strings.xml in my /res folder
- /values/strings.xml (default)
- /values-zh/strings.xml (for locale with language code = zh)

so what i have done now is if the phone locale is not with language
code zh, default strings.xml is shown. and if the locale is zh-TW
(Taiwan) or zh-CN(China), /values-zh/strings.xml is shown.

i supposed zh-TW should show the Traditional Chinese and zh-CN should
show the Simplified Chinese. so i modified the /res folder as follow
- /values/strings.xml (default)
- /values-zh-rCN/strings.xml (for locale = zh-CN)
- /values-zh-rTW/strings.xml (for locale = zh-TW)

but this doesn't wok, now only default strings.xml is shown no matter
which locale is set.

Thanks,

Regards,
Kit
Post by HeHe
not quite get your question.
selection of the resource folder should be automatic, as indicated in
        android-sdk-windows/docs/guide/topics/resources/resources-
i18n.html
the current locale of your phone/emulator can be learned by
                Locale.getDefault();
hope this helpful to you.
Post by Kit
i want to create an application which supports both simplified and
traditional chinese. so i created 2 strings.xml in values-zh-rCN (sim.
chi) and values-zh-rTW (tra. chi). but then i run the application in
the emulator, it seems that only the default strings.xml is loaded.
i tried to use values-zh as the strings.xml folder. it will be loaded
for both zh-CN and zh-TW locales. so is that i cannot add region code
for the strings.xml?
Thanks for your answer
Regards,
Kit
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Kit
2009-12-14 12:50:01 UTC
Permalink
Sorry, i just realized that i have to restart the emulator after
changing the locale.
the localization works now. Thanks.
Post by Kit
Hi HeHe,
Thanks for your reply and sorry for the misleading. let me clarify my
question.
i didn't make any coding on localization. what it want to do is to let
my application shows either traditional chinese/simplified chinese
depending on the phone locale. currently i got the following two
strings.xml in my /res folder
    - /values/strings.xml (default)
    - /values-zh/strings.xml  (for locale with language code = zh)
so what i have done now is if the phone locale is not with language
code zh, default strings.xml is shown. and if the locale is zh-TW
(Taiwan) or zh-CN(China), /values-zh/strings.xml is shown.
i supposed zh-TW should show the Traditional Chinese and zh-CN should
show the Simplified Chinese. so i modified the /res folder as follow
    - /values/strings.xml (default)
    - /values-zh-rCN/strings.xml  (for locale = zh-CN)
    - /values-zh-rTW/strings.xml  (for locale = zh-TW)
but this doesn't wok, now only default strings.xml is shown no matter
which locale is set.
Thanks,
Regards,
Kit
Post by HeHe
not quite get your question.
selection of the resource folder should be automatic, as indicated in
        android-sdk-windows/docs/guide/topics/resources/resources-
i18n.html
the current locale of your phone/emulator can be learned by
                Locale.getDefault();
hope this helpful to you.
Post by Kit
i want to create an application which supports both simplified and
traditional chinese. so i created 2 strings.xml in values-zh-rCN (sim.
chi) and values-zh-rTW (tra. chi). but then i run the application in
the emulator, it seems that only the default strings.xml is loaded.
i tried to use values-zh as the strings.xml folder. it will be loaded
for both zh-CN and zh-TW locales. so is that i cannot add region code
for the strings.xml?
Thanks for your answer
Regards,
Kit
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
HeHe
2009-12-14 17:38:47 UTC
Permalink
killing your app in DDMS and re-run it should work, too.
Post by Kit
Sorry, i just realized that i have to restart the emulator after
changing the locale.
the localization works now. Thanks.
Post by Kit
Hi HeHe,
Thanks for your reply and sorry for the misleading. let me clarify my
question.
i didn't make any coding on localization. what it want to do is to let
my application shows either traditional chinese/simplified chinese
depending on the phone locale. currently i got the following two
strings.xml in my /res folder
    - /values/strings.xml (default)
    - /values-zh/strings.xml  (for locale with language code = zh)
so what i have done now is if the phone locale is not with language
code zh, default strings.xml is shown. and if the locale is zh-TW
(Taiwan) or zh-CN(China), /values-zh/strings.xml is shown.
i supposed zh-TW should show the Traditional Chinese and zh-CN should
show the Simplified Chinese. so i modified the /res folder as follow
    - /values/strings.xml (default)
    - /values-zh-rCN/strings.xml  (for locale = zh-CN)
    - /values-zh-rTW/strings.xml  (for locale = zh-TW)
but this doesn't wok, now only default strings.xml is shown no matter
which locale is set.
Thanks,
Regards,
Kit
Post by HeHe
not quite get your question.
selection of the resource folder should be automatic, as indicated in
        android-sdk-windows/docs/guide/topics/resources/resources-
i18n.html
the current locale of your phone/emulator can be learned by
                Locale.getDefault();
hope this helpful to you.
Post by Kit
i want to create an application which supports both simplified and
traditional chinese. so i created 2 strings.xml in values-zh-rCN (sim.
chi) and values-zh-rTW (tra. chi). but then i run the application in
the emulator, it seems that only the default strings.xml is loaded.
i tried to use values-zh as the strings.xml folder. it will be loaded
for both zh-CN and zh-TW locales. so is that i cannot add region code
for the strings.xml?
Thanks for your answer
Regards,
Kit
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Loading...