mirror of https://github.com/OpenRCT2/OpenRCT2.git
[Linux] Implement platform_get_locale_currency.
Fix Chinese language codes.
This commit is contained in:
parent
3ece04dc8d
commit
b4907ba70c
|
@ -664,10 +664,10 @@ uint16 platform_get_locale_language(){
|
||||||
if(!fnmatch(pattern, "en_CA", 0)){
|
if(!fnmatch(pattern, "en_CA", 0)){
|
||||||
return LANGUAGE_ENGLISH_US;
|
return LANGUAGE_ENGLISH_US;
|
||||||
}
|
}
|
||||||
else if (!fnmatch(pattern, "zn_CA", 0)){
|
else if (!fnmatch(pattern, "zh_CN", 0)){
|
||||||
return LANGUAGE_CHINESE_SIMPLIFIED;
|
return LANGUAGE_CHINESE_SIMPLIFIED;
|
||||||
}
|
}
|
||||||
else if (!fnmatch(pattern, "zn_TW", 0)){
|
else if (!fnmatch(pattern, "zh_TW", 0)){
|
||||||
return LANGUAGE_CHINESE_TRADITIONAL;
|
return LANGUAGE_CHINESE_TRADITIONAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -694,47 +694,24 @@ time_t platform_file_get_modified_time(const utf8* path){
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 platform_get_locale_currency(){
|
uint8 platform_get_locale_currency(){
|
||||||
/*
|
char *langstring = setlocale(LC_MONETARY, "");
|
||||||
CHAR currCode[4];
|
struct lconv *lc = localeconv();
|
||||||
|
|
||||||
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
|
//Only works if g_currency_specs contains the actual (local) symbol
|
||||||
LOCALE_SINTLSYMBOL,
|
for(int i = 0; i < CURRENCY_END; ++i){
|
||||||
(LPSTR)&currCode,
|
if(!strcmp(lc->currency_symbol, g_currency_specs[i].symbol)){
|
||||||
sizeof(currCode)) == 0){
|
return i;
|
||||||
return CURRENCY_POUNDS;
|
}
|
||||||
}
|
}
|
||||||
if (strcmp(currCode, "GBP") == 0){
|
//TODO: can be removed when g_currency_specs contains the actual symbols for won and rubel
|
||||||
return CURRENCY_POUNDS;
|
if(!strncmp(lc->int_curr_symbol, "KRW", 3)){
|
||||||
|
return CURRENCY_WON;
|
||||||
}
|
}
|
||||||
else if (strcmp(currCode, "USD") == 0){
|
else if(!strncmp(lc->int_curr_symbol, "RUB", 3)){
|
||||||
return CURRENCY_DOLLARS;
|
return CURRENCY_ROUBLE;
|
||||||
}
|
}
|
||||||
else if (strcmp(currCode, "EUR") == 0){
|
|
||||||
return CURRENCY_EUROS;
|
//All other currencies are historic
|
||||||
}
|
|
||||||
else if (strcmp(currCode, "SEK") == 0){
|
|
||||||
return CURRENCY_KRONA;
|
|
||||||
}
|
|
||||||
else if (strcmp(currCode, "DEM") == 0){
|
|
||||||
return CURRENCY_DEUTSCHMARK;
|
|
||||||
}
|
|
||||||
else if (strcmp(currCode, "ITL") == 0){
|
|
||||||
return CURRENCY_LIRA;
|
|
||||||
}
|
|
||||||
else if (strcmp(currCode, "JPY") == 0){
|
|
||||||
return CURRENCY_YEN;
|
|
||||||
}
|
|
||||||
else if (strcmp(currCode, "ESP") == 0){
|
|
||||||
return CURRENCY_PESETA;
|
|
||||||
}
|
|
||||||
else if (strcmp(currCode, "FRF") == 0){
|
|
||||||
return CURRENCY_FRANC;
|
|
||||||
}
|
|
||||||
else if (strcmp(currCode, "NLG") == 0){
|
|
||||||
return CURRENCY_GUILDERS;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
STUB();
|
|
||||||
return CURRENCY_POUNDS;
|
return CURRENCY_POUNDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue