언어 설정

Menu
Sites
Language
Localization - DEFAULT LANGUAGE

I am implementing multi-language support for Tizen native app and I have problem with setting default language.

Is it possible to set default language (i.e. English) if proper PO file for system selected language does not exist?

How can we do it?

답변 바로가기

Responses

6 댓글
Jeongsu Kim

make msgid itself as msgstr in English in the po file.

en_US.po

msgid "Sample text"
msgstr "Sample text"

 

ko_KR.po

msgid "Sample text"
msgstr "예제 텍스트"

Marcin Nowak

Thank you for quick reply.

I have 3 PO file: en.po, fr_FR.po and pl_PL.po. When I change language to i.e. Korean (language for which I have no prepared PO file), I have msgid displayed in my widgets (according to documentation it is the way it works). But I would like to have English textes when I change language to not supported language by me (i.e. here Korean). Do you know how to force Tizen to use en_US.po when proper PO file for system locale language is not available?

Actually I get current locale language from system settings and if it is language not supported by me, I set en_US using : elm_language_set("en_US.utf8");

Mark as answer
Jeongsu Kim

ok, then I think you can apply this routine.

1. hardcord supported languages in your app

2. in the app_created callback, and language changed callback, check current language.
if it is not supported, change the locale to "en_US"

setenv("LANG", "en_US", 1);
setenv("LC_MESSAGES", "en_US", 1);
setlocale(LC_ALL, "en_US");
 

3. then call elm_language_set api to apply new language

 

Alexandros Chronopoulos

I try to use the elm_language_set() to change the language in my app but it does not work. Even if I set the enviromental variables mention above the language of the app does not change. The strange thing is that the general change language call back method use this method and it works. When I use the method in onother place of my app nothing happen.

Any idea?

pius lee

elm_language_set is not redrawing every widget.

Most of text orient widget has "language,changed" signal for language changing time. If you want change text or image on changing, do changing in callback that is registed as "language,changed".

Or if you want you widget change text automatically on changing language then you can use following function

elm_object_domain_translatable_part_text_set

elm_object_item_domain_translatable_part_text_set 

 

Alexandros Chronopoulos

Thanks for the reply! My problem was that I did not use fully qualified language code and solved by appending a ".utf8" (in my case) at it. Another thing I noticed is that the general change language call back does not use the correct format too but it works! After some hard coded tests I end up with the assumption that when the elm_language_set() method do not receive the language in a correct format it falls back to the system's current language. If it is different the update is triggered otherwise nothing happen.