mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-07 21:50:08 +01:00
e0eba8ce21
```bash find . -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) ! -path "src/3rdparty/*" -print0 | xargs -0 clang-format -i ```
23 lines
467 B
C
23 lines
467 B
C
#include "detection/locale/locale.h"
|
|
|
|
#include <locale.h>
|
|
|
|
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";
|
|
}
|