diff --git a/src/lib/fcitx-utils/i18nstring.cpp b/src/lib/fcitx-utils/i18nstring.cpp index 96b84461..2c6f7436 100644 --- a/src/lib/fcitx-utils/i18nstring.cpp +++ b/src/lib/fcitx-utils/i18nstring.cpp @@ -14,9 +14,10 @@ const std::string &I18NString::match(const std::string &locale_) const { std::string locale = locale_; if (locale == "system") { char *lc = nullptr; - if constexpr (isAndroid()) { + if constexpr (isAndroid() || isApple()) { // bionic doesn't recognize locale other than C or C.UTF-8 // https://android.googlesource.com/platform/bionic/+/refs/tags/android-11.0.0_r48/libc/bionic/locale.cpp#175 + // macOS returns C for setlocale(LC_MESSAGES, nullptr) lc = getenv("FCITX_LOCALE"); } else { lc = setlocale(LC_MESSAGES, nullptr);