Skip to content

Commit

Permalink
Use lower() on LC_MESSAGES only if it is a string and not None
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-fabian committed Nov 10, 2022
1 parent 38d844b commit ca296cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion engine/main.py
Expand Up @@ -278,7 +278,9 @@ def write_xml() -> None:
# getdefaultlocale() returns something like ('ja_JP', 'UTF-8').
# In case of C/POSIX locale it returns (None, None)
locale.setlocale(locale.LC_ALL, '')
_locale = locale.getlocale(locale.LC_MESSAGES)[0].lower()
_locale = locale.getlocale(locale.LC_MESSAGES)[0]
if _locale:
_locale = _locale.lower()
if not _locale:
_locale = 'en'
_longname.text = _sq_db.ime_properties.get(
Expand Down

0 comments on commit ca296cb

Please sign in to comment.