MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetLocaleMeasurementFormat

Function GetLocaleMeasurementFormat

src/openrct2/platform/Platform.Linux.cpp:325–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323 }
324
325 MeasurementFormat GetLocaleMeasurementFormat()
326 {
327 // LC_MEASUREMENT is GNU specific.
328 #ifdef LC_MEASUREMENT
329 const char* langstring = setlocale(LC_MEASUREMENT, "");
330 #else
331 const char* langstring = setlocale(LC_ALL, "");
332 #endif
333
334 if (langstring != nullptr)
335 {
336 // using https://en.wikipedia.org/wiki/Metrication#Chronology_and_status_of_conversion_by_country as reference
337 if (!fnmatch("*_US*", langstring, 0) || !fnmatch("*_MM*", langstring, 0) || !fnmatch("*_LR*", langstring, 0))
338 {
339 return MeasurementFormat::imperial;
340 }
341 }
342 return MeasurementFormat::metric;
343 }
344
345 SteamPaths GetSteamPaths()
346 {

Callers 1

ReadGeneralFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected