Closed seyyah closed 5 years ago
lv_i18n_init(lv_i18n_language_pack);
IMHO this is more readable. It's used only once and no need to save 4 chars.
But it's not principal for me, and i'm ready to accept any result of majority voting.
@kisvegabor , @embeddedt , could you tell us your preferences?
For consistency, we really should use the same naming. So either:
lv_i18n_lang_pack_t lv_i18n_lang_pack;
lv_i18n_language_pack_t lv_i18n_language_pack;
is fine for me.
If questions is in consistency only, i'd prefer lv_i18n_language_pack_t lv_i18n_language_pack
.
Can do it right not, if nobody objects.
We can use @kisvegabor' two styles at L114,
const lv_i18n_lang_pack_t lv_i18n_language_pack[] = {
&en_gb_lang,
...
};
For minimal code change, we prefer to use lv_i18n_lang_pack_t lv_i18n_lang_pack;
. Otherwise we change extra en_gb_lang
's type,
static const lv_i18n_lang_t de_de_lang = {...}
Refered parts are:
Their change costs nothing. IMHO the only thing, that does matter, is public API. In our case, this code in userspace:
#include "lv_i18n/lv_i18n.h"
lv_i18n_init(lv_i18n_language_pack);
// or lv_i18n_init(lv_i18n_lang_pack);
That's the only difference, visible from user's point of view. I think, public API should not be driven by implementation details if possible.
@puzrin your idea is suitable for me. So we may use
lv_i18n_init(lv_i18n_language_pack);
lv_i18n_init
function argument type islv_i18n_lang_pack_t
butlv_i18n_language_pack
variable name is used in the generated file (i18n.c
). I suggest to uselv_i18n_lang_pack
variable name for consistency/readability purpose.In this case simple example'll be