char input

Dependencies:   TS_DISCO_F746NG mbed LCD_DISCO_F746NG BSP_DISCO_F746NG lvgl_RB FastPWM millis

Committer:
becanromain
Date:
Thu Feb 27 23:18:20 2020 +0000
Revision:
6:519d681050af
Parent:
4:6a3d12663549

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
becanromain 4:6a3d12663549 1
becanromain 4:6a3d12663549 2 //Multilangue
becanromain 4:6a3d12663549 3 //lvgl has lv_i18n module for internationalization: https://github.com/littlevgl/lv_i18n
becanromain 4:6a3d12663549 4 // - It's a script which automatically extracts the strings to translate from you code
becanromain 4:6a3d12663549 5 // - However to run the script you need the code offline
becanromain 4:6a3d12663549 6 // - An other option is to manually create the internationalization file
becanromain 4:6a3d12663549 7 // - I've added lv_i18n.c/h as a reference
becanromain 4:6a3d12663549 8 // - You can test it like this
becanromain 4:6a3d12663549 9 // lv_i18n_init(lv_i18n_language_pack);
becanromain 4:6a3d12663549 10 // lv_i18n_set_locale("en-GB");
becanromain 4:6a3d12663549 11 // printf(_("dog"));
becanromain 4:6a3d12663549 12 // printf("\n");
becanromain 4:6a3d12663549 13 //
becanromain 4:6a3d12663549 14 // lv_i18n_set_locale("fr");
becanromain 4:6a3d12663549 15 // printf(_("dog"));
becanromain 4:6a3d12663549 16 // printf("\n");
becanromain 4:6a3d12663549 17 //
becanromain 4:6a3d12663549 18 // - '_' is a function which get the translated version of "dog" and "cat" in the given local
becanromain 4:6a3d12663549 19 // - You can use it with labels: lv_label_set_text(label, _("dog"))
becanromain 4:6a3d12663549 20 // - Translation with prinf-like format characters are also possible. E.g.
becanromain 4:6a3d12663549 21 // - In lv_i18n.c: {"user_count", "There are %d users"},
becanromain 4:6a3d12663549 22 // - Usage:
becanromain 4:6a3d12663549 23 // char buf[128];
becanromain 4:6a3d12663549 24 // sprintf(buf, _("user_count"), 55);
becanromain 4:6a3d12663549 25 //
becanromain 4:6a3d12663549 26 // - Or:
becanromain 4:6a3d12663549 27 // lv_label_set_text_fmt(label, _("user_count"), 55);