From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/detection/locale/locale_linux.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/detection/locale/locale_linux.c (limited to 'src/detection/locale/locale_linux.c') diff --git a/src/detection/locale/locale_linux.c b/src/detection/locale/locale_linux.c new file mode 100644 index 0000000..4c04f26 --- /dev/null +++ b/src/detection/locale/locale_linux.c @@ -0,0 +1,22 @@ +#include "detection/locale/locale.h" + +#include + +const char* ffDetectLocale(FFstrbuf* result) { + ffStrbufAppendS(result, getenv("LC_ALL")); + if (result->length > 0) { + return NULL; + } + + ffStrbufAppendS(result, getenv("LANG")); + if (result->length > 0) { + return NULL; + } + + ffStrbufAppendS(result, setlocale(LC_TIME, NULL)); + if (result->length > 0) { + return NULL; + } + + return "Failed to detect locale"; +} -- cgit v1.2.3