How to achieve GUI language switch

I am now using LVGL 7.4

Want to achieve GUI interface language switching function.

For example, switch from Simplified Chinese to English and from English to Simplified Chinese.

But there is no good way.

I think https://github.com/lvgl/lv_i18n is what you are looking for.

1 Like

I opened the top link, but I couldn’t quite see it.
After clicking on the language switch, how should I achieve the errorless task of refreshing all text display content, after all, there are too many interfaces to display text.

I think you would need to re-run whatever functions are using text (e.g. lv_label_set_text) in order for them to pick up on the new locale. There’s no way around that, because LVGL can’t automatically find a new string.

Another (possibly simpler) option is to store the locale in nonvolatile memory and restart your device if the language is changed. Then it will pick up on the changes at the next boot.