From fc0079369fd2cdbd4e940cf1e78c34d0949f5010 Mon Sep 17 00:00:00 2001 From: moi15moi <80980684+moi15moi@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:37:01 -0500 Subject: [PATCH] [system_lang\linux_lang] Add a exception when getlocale is equal to "C" --- font_collector/system_lang/linux_lang.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/font_collector/system_lang/linux_lang.py b/font_collector/system_lang/linux_lang.py index 103f985..cf746e9 100644 --- a/font_collector/system_lang/linux_lang.py +++ b/font_collector/system_lang/linux_lang.py @@ -6,6 +6,7 @@ class LinuxLang(ABCSystemLang): @staticmethod def get_lang() -> str: lang, _ = getlocale() - if lang is None: + # C means that the locale isn't set. See: https://docs.python.org/3/library/locale.html#locale.getlocale + if lang is None or lang == "C": lang = ABCSystemLang.default_lang return lang