mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 23:15:38 +00:00
(Linux) Added workaround for a library or OS bug that prevented some locales from working correctly
This commit is contained in:
parent
75bff1f0df
commit
2dc805bcbd
|
@ -174,6 +174,12 @@ namespace Utils
|
||||||
#else
|
#else
|
||||||
setenv("LANGUAGE", locale.c_str(), 1);
|
setenv("LANGUAGE", locale.c_str(), 1);
|
||||||
setenv("LANG", locale.c_str(), 1);
|
setenv("LANG", locale.c_str(), 1);
|
||||||
|
// For some bizarre reason we need to first set the locale to en_US.UTF-8 before
|
||||||
|
// we set it to the requested locale as some specific locales like pt_BR and zh_CN
|
||||||
|
// otherwise won't work consistently. This must be some kind of library or OS bug as
|
||||||
|
// it only happens on regular Linux, and not on macOS, Windows, Android or FreeBSD.
|
||||||
|
setlocale(LC_MESSAGES, std::string {"en_US.UTF-8"}.c_str());
|
||||||
|
|
||||||
setlocale(LC_MESSAGES, std::string {locale + ".UTF-8"}.c_str());
|
setlocale(LC_MESSAGES, std::string {locale + ".UTF-8"}.c_str());
|
||||||
#endif
|
#endif
|
||||||
textdomain(locale.c_str());
|
textdomain(locale.c_str());
|
||||||
|
|
Loading…
Reference in a new issue