lvgl / lv_i18n

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

corrupted escape characters #66

Open bryghtlabs-richard opened 2 months ago

bryghtlabs-richard commented 2 months ago

If I place _("Preparing\nUpdate") in my code, lv_i18n extract works, and I'll add the German translation:

en:
  Preparing\nUpdate: ~
de:
  Preparing\nUpdate: ~: Update\nvorbereiten

But it seems lv_i18n compile is over-escaping, and produces the following German table:

static lv_i18n_phrase_t de_singulars[] = {
    {"Preparing\\nUpdate", "Update\\nvorbereiten"},
    {NULL, NULL} // End mark
};

Which encodes to:

Preparing\nUpdate

Instead of the expected:

Preparing
Update

This breaks translations, as lv_i18n_get_text() is expecting an over-escaped version of the input, but passed the original input.