Skip to content

Commit

Permalink
[system_lang\linux_lang] Add a exception when getlocale is equal to "C"
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Jan 23, 2024
1 parent 2561d4a commit fc00793
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion font_collector/system_lang/linux_lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fc00793

Please sign in to comment.