mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-21 06:53:01 +08:00
i18n add const prefixes where required
This commit is contained in:
parent
fcf1d52e4a
commit
b9ed89a976
@ -28,8 +28,8 @@ static const void * lv_i18n_get_text_core(lv_i18n_trans_t * trans, const char *
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_i18n_lang_t ** languages;
|
||||
static lv_i18n_lang_t * local_lang;
|
||||
static const lv_i18n_lang_t ** languages;
|
||||
static const lv_i18n_lang_t * local_lang;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@ -70,7 +70,6 @@ void lv_i18n_set_local(const char * lang_code)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint16_t i;
|
||||
for(i = 0; languages[i] != NULL; i++) {
|
||||
if(strcmp(languages[i]->name, lang_code) == 0) break; /*A language has found*/
|
||||
@ -99,7 +98,7 @@ const void * lv_i18n_get_text(const char * msg_id)
|
||||
return msg_id;
|
||||
}
|
||||
|
||||
lv_i18n_lang_t * lang = local_lang;
|
||||
const lv_i18n_lang_t * lang = local_lang;
|
||||
|
||||
if(lang->simple == NULL) {
|
||||
if(lang == languages[0]) {
|
||||
@ -156,7 +155,8 @@ const void * lv_i18n_get_text_plural(const char * msg_id, int32_t num)
|
||||
return msg_id;
|
||||
}
|
||||
|
||||
lv_i18n_lang_t * lang = local_lang;
|
||||
const lv_i18n_lang_t * lang = local_lang;
|
||||
|
||||
if(lang->plurals == NULL || lang->plural_rule == NULL) {
|
||||
if(lang == languages[0]) {
|
||||
LV_LOG_WARN("lv_i18n_get_text_plural: No plurals or plural rule has defined even on the default language");
|
||||
|
Loading…
x
Reference in New Issue
Block a user