mirror of https://github.com/i3/i3lock.git
Merge pull request #140 from bluetech/fix-locale-discovery
Change the locale discovery procedure to treat empty string same as unsetpull/142/head
commit
14667d8304
6
i3lock.c
6
i3lock.c
|
@ -977,11 +977,11 @@ int main(int argc, char *argv[]) {
|
||||||
errx(EXIT_FAILURE, "Could not load keymap");
|
errx(EXIT_FAILURE, "Could not load keymap");
|
||||||
|
|
||||||
const char *locale = getenv("LC_ALL");
|
const char *locale = getenv("LC_ALL");
|
||||||
if (!locale)
|
if (!locale || !*locale)
|
||||||
locale = getenv("LC_CTYPE");
|
locale = getenv("LC_CTYPE");
|
||||||
if (!locale)
|
if (!locale || !*locale)
|
||||||
locale = getenv("LANG");
|
locale = getenv("LANG");
|
||||||
if (!locale) {
|
if (!locale || !*locale) {
|
||||||
if (debug_mode)
|
if (debug_mode)
|
||||||
fprintf(stderr, "Can't detect your locale, fallback to C\n");
|
fprintf(stderr, "Can't detect your locale, fallback to C\n");
|
||||||
locale = "C";
|
locale = "C";
|
||||||
|
|
Loading…
Reference in New Issue