diff --git a/source/libublsettings-locale.c b/source/libublsettings-locale.c index 70e91bc..cddf1ec 100644 --- a/source/libublsettings-locale.c +++ b/source/libublsettings-locale.c @@ -32,7 +32,7 @@ void yon_locale_set(struct yon_locale *target,char *locale_name){ int size; char *path = yon_char_unite(locales_path,locale_name,NULL); config_str locale_string = yon_file_open(path,&size); - target->code = yon_char_new(locale_name); + target->code = yon_char_unite(locale_name,".UTF-8",NULL); target->lang_ab = yon_char_new(locale_name); target->territory = yon_char_parsed_check_exist_begins_with(locale_string,size,"territory"); target->language = yon_char_parsed_check_exist_begins_with(locale_string,size,"language"); @@ -113,6 +113,9 @@ char *yon_locale_get_parameter(char *code,enum YON_LOCALE_PARAMETER type){ case YON_LOCALE_TITLE:{ return cur_locale->title; }break; + case YON_LOCALE_CODE:{ + return cur_locale->code; + }break; } } \ No newline at end of file diff --git a/source/libublsettings.h b/source/libublsettings.h index 344a4d0..a0dd4a6 100644 --- a/source/libublsettings.h +++ b/source/libublsettings.h @@ -1500,7 +1500,8 @@ enum YON_LOCALE_PARAMETER{ YON_LOCALE_LANG_NAME, YON_LOCALE_TERRITORY, YON_LOCALE_LANG_AB, - YON_LOCALE_TITLE + YON_LOCALE_TITLE, + YON_LOCALE_CODE }; typedef struct yon_hash_element{