From 16b10c162b11e0cea3a368d6d5d4f4a6eb206eaa Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 12 Aug 2026 10:07:34 +0800 Subject: [PATCH] Revert "Locale (macOS): queries system-wide locale preference" This reverts commit 8b8efcdcce100594fc81f10b79df5b13632754c3. --- CMakeLists.txt | 2 +- src/detection/locale/locale_apple.c | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 src/detection/locale/locale_apple.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e86d3d40..94400df85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1038,7 +1038,7 @@ elseif(APPLE) src/detection/lm/lm_nosupport.c src/detection/loadavg/loadavg_bsd.c src/detection/libc/libc_apple.c - src/detection/locale/locale_apple.c + src/detection/locale/locale_linux.c src/detection/localip/localip_linux.c src/detection/gamepad/gamepad_apple.c src/detection/media/media_apple.m diff --git a/src/detection/locale/locale_apple.c b/src/detection/locale/locale_apple.c deleted file mode 100644 index c5a5e8e1a..000000000 --- a/src/detection/locale/locale_apple.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "detection/locale/locale.h" -#include "common/apple/cf_helpers.h" - -const char* ffDetectLocale(FFstrbuf* result) { - // Read the system-wide locale preference (equivalent to `defaults read -g AppleLocale`), - // which is NOT affected by user environment variables (LANG, LC_ALL, etc.) - FF_CFTYPE_AUTO_RELEASE CFStringRef appleLocale = CFPreferencesCopyAppValue(CFSTR("AppleLocale"), kCFPreferencesAnyApplication); - if (!appleLocale) { - return "Failed to read AppleLocale"; - } - - return ffCfStrGetString(appleLocale, result); -}