lvgl / lv_i18n

Internationalization (i18n) for LVGL
MIT License
58 stars 17 forks source link

Escape character "\" will be doubled. #49

Closed bubeck closed 1 year ago

bubeck commented 1 year ago

The following is an example of the problem

printf(_("Hello World\n"));

it extracts correctly to yml and is then translated

de-DE:
  Hello World\n: Hallo Welt\n

if compiled to source we get:

static lv_i18n_phrase_t de_de_singulars[] = {
    {"Hello World\\n", "Hallo Welt\\n"},

which is obviously wrong, as it should be

static lv_i18n_phrase_t de_de_singulars[] = {
    {"Hello World\n", "Hallo Welt\n"},
bubeck commented 1 year ago

Fixed by https://github.com/lvgl/lv_i18n/commit/a5c19c3c20bc92b6dbef2506941421ed1509c49d Please release new version including this fix.

puzrin commented 1 year ago

AFAIK, release was postponed due comments in https://github.com/lvgl/lv_i18n/commit/593707dedd0afda097e4cc3bc139782f360797af

@kisvegabor could you take a look?

JeremiahGillis commented 1 year ago

I ran into this bug today because I installed from npm i lv_i18n -g.

This has been fixed in the master branch. I would recommend creating a new release when you have a moment. I see the potential for others to encounter this bug who use SquadLine Studio and use multiline text.