lvgl / lv_i18n

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

fr-FR: syntax errors on "lv_i18n compile" when used with french #54

Closed bubeck closed 1 year ago

bubeck commented 1 year ago

I have this yml file called fr-FR.yml

fr-FR:
  key1: key1f
  key2: key2f

when using lvi18n compile -l fr-FR -t '*.yml' --raw lv_i18n_data.inc I get the following plural function, that contains many errors:

static uint8_t fr_fr_plural_fn(int32_t num)
{
    uint32_t n = op_n(num); UNUSED(n);
    uint32_t i = op_i(n); UNUSED(i);
    uint32_t v = op_v(n); UNUSED(v);
    uint32_t i1000000 = i % 1000000;
    if ((((i == 0) || (i == 1)))) return LV_I18N_PLURAL_TYPE_ONE;
    if ((e == 0 && i != 0 && i1000000 == 0 && v == 0) || (e != 0..5)) return LV_I18N_PLURAL_TYPE_MANY;
    return LV_I18N_PLURAL_TYPE_OTHER;
}

I see at least the following errors:

  1. "e" is undefined
  2. "0..5" is invalid

Am I wrong or is there a bug?

kisvegabor commented 1 year ago

cc @puzrin

puzrin commented 1 year ago

Regression in 32f5fc26a6c0a5d5c76603084e6a110933d6a376

Check master please, and let me know any problem missed.