How to display multi-language on the screen with LVGL using Gui Guider?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to display multi-language on the screen with LVGL using Gui Guider?

ソリューションへジャンプ
3,512件の閲覧回数
ChesterLee
Contributor II

Now I'm going to develop a product with displaying multi-language (such as Chinese, English, Russian, etc.) on the LCD screen using LVGL. I wonder if there is a way to set widgets' texts with parameters? Like define a series of parameters about language and use them set text content:

/* --------------------------- Code example --------------------------- */

typedef struct {

    char *itemChinese,

    char *itemEnglish,

} param_language_t;

param_language_t param_language = {

    .itemChinese = "你好",

    .itemEnglish = "Hello",

};

lv_label_set_text_fmt(ui->screen_main_label_hello, "%s", param_language.itemEnglish);

/* --------------------------- Code example --------------------------- */

Or just using a middleware named lv_i18n, which also needs using parameters to set widgets text.

タグ(2)
0 件の賞賛
返信
1 解決策
3,479件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

Hello @ChesterLee ,

Thanks for your post. According to GUI Guider v1.8.1 User Guide, currently the GUI Guider IDE only supports two language: English and Chinese. However, this can be achieved by developing custom code. The following is an example.

Celeste_Liu_0-1731562555570.png

For the detailed description of this example, you can refer to the section of "7.10 How to develop a multi - language application".

Celeste_Liu_1-1731563390966.png

Hope it helps.

Best Regards,

Celeste

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
3,480件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

Hello @ChesterLee ,

Thanks for your post. According to GUI Guider v1.8.1 User Guide, currently the GUI Guider IDE only supports two language: English and Chinese. However, this can be achieved by developing custom code. The following is an example.

Celeste_Liu_0-1731562555570.png

For the detailed description of this example, you can refer to the section of "7.10 How to develop a multi - language application".

Celeste_Liu_1-1731563390966.png

Hope it helps.

Best Regards,

Celeste

0 件の賞賛
返信
3,475件の閲覧回数
ChesterLee
Contributor II

Hi @Celeste_Liu ,

Tks for your kindly reply. I wish Gui Guider could support more languages in the future. Anyway, tks a lot!

Best Regard

Chester

0 件の賞賛
返信
3,456件の閲覧回数
Celeste_Liu
NXP Employee
NXP Employee

Hello @ChesterLee ,

I'm glad to help you. I will feed back your suggestion. Any new issues, welcome to create a new thread.

BRs,

Celeste

0 件の賞賛
返信