Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fixed shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
salt-die committed Jan 26, 2020
1 parent d9d3d41 commit c33fd63
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions circumstantial-companions/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
with open("locales.json", encoding="utf-8") as file:
LOCALES = json.load(file)

for locale in LOCALES:
if locale == DEFAULT_LOCALE:
TRANSLATIONS[locale] = gettext.NullTranslations()
for locale_ in LOCALES:
if locale_ == DEFAULT_LOCALE:
TRANSLATIONS[locale_] = gettext.NullTranslations()
continue

path = Path("locales") / locale / "LC_MESSAGES"
path = Path("locales") / locale_ / "LC_MESSAGES"
with (path / "messages.po").open(encoding="utf-8") as file:
catalog = read_po(file, ignore_obsolete=True)
with (path / "messages.mo").open("wb") as file:
write_mo(file, catalog)
TRANSLATIONS[locale] = gettext.translation("messages", "locales", [locale])
TRANSLATIONS[locale_] = gettext.translation("messages", "locales", [locale_])

0 comments on commit c33fd63

Please sign in to comment.