Added code returning to locale get function

pull/69/head
parent dfe12c5e20
commit e525efc2e8

@ -32,7 +32,7 @@ void yon_locale_set(struct yon_locale *target,char *locale_name){
int size; int size;
char *path = yon_char_unite(locales_path,locale_name,NULL); char *path = yon_char_unite(locales_path,locale_name,NULL);
config_str locale_string = yon_file_open(path,&size); 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->lang_ab = yon_char_new(locale_name);
target->territory = yon_char_parsed_check_exist_begins_with(locale_string,size,"territory"); 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"); 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:{ case YON_LOCALE_TITLE:{
return cur_locale->title; return cur_locale->title;
}break; }break;
case YON_LOCALE_CODE:{
return cur_locale->code;
}break;
} }
} }

@ -1500,7 +1500,8 @@ enum YON_LOCALE_PARAMETER{
YON_LOCALE_LANG_NAME, YON_LOCALE_LANG_NAME,
YON_LOCALE_TERRITORY, YON_LOCALE_TERRITORY,
YON_LOCALE_LANG_AB, YON_LOCALE_LANG_AB,
YON_LOCALE_TITLE YON_LOCALE_TITLE,
YON_LOCALE_CODE
}; };
typedef struct yon_hash_element{ typedef struct yon_hash_element{

Loading…
Cancel
Save