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.