mirror of https://github.com/OpenRCT2/OpenRCT2.git
osx: fix locale issues
This commit is contained in:
parent
59a1701ccc
commit
5d03fc3fb6
|
@ -700,8 +700,12 @@ uint8 platform_get_locale_currency(){
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 platform_get_locale_measurement_format(){
|
uint8 platform_get_locale_measurement_format(){
|
||||||
//FIXME: LC_MEASUREMENT is GNU specific.
|
// LC_MEASUREMENT is GNU specific.
|
||||||
|
#ifdef LC_MEASUREMENT
|
||||||
const char *langstring = setlocale(LC_MEASUREMENT, "");
|
const char *langstring = setlocale(LC_MEASUREMENT, "");
|
||||||
|
#else
|
||||||
|
const char *langstring = setlocale(LC_ALL, "");
|
||||||
|
#endif
|
||||||
|
|
||||||
if(langstring != NULL){
|
if(langstring != NULL){
|
||||||
//using https://en.wikipedia.org/wiki/Metrication#Chronology_and_status_of_conversion_by_country as reference
|
//using https://en.wikipedia.org/wiki/Metrication#Chronology_and_status_of_conversion_by_country as reference
|
||||||
|
@ -713,7 +717,12 @@ uint8 platform_get_locale_measurement_format(){
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 platform_get_locale_temperature_format(){
|
uint8 platform_get_locale_temperature_format(){
|
||||||
|
// LC_MEASUREMENT is GNU specific.
|
||||||
|
#ifdef LC_MEASUREMENT
|
||||||
const char *langstring = setlocale(LC_MEASUREMENT, "");
|
const char *langstring = setlocale(LC_MEASUREMENT, "");
|
||||||
|
#else
|
||||||
|
const char *langstring = setlocale(LC_ALL, "");
|
||||||
|
#endif
|
||||||
|
|
||||||
if(langstring != NULL){
|
if(langstring != NULL){
|
||||||
if(!fnmatch("*_US*", langstring, 0) || !fnmatch("*_BS*", langstring, 0) || !fnmatch("*_BZ*", langstring, 0) || !fnmatch("*_PW*", langstring, 0)){
|
if(!fnmatch("*_US*", langstring, 0) || !fnmatch("*_BS*", langstring, 0) || !fnmatch("*_BZ*", langstring, 0) || !fnmatch("*_PW*", langstring, 0)){
|
||||||
|
|
Loading…
Reference in New Issue