Browse Source

Remove deprecated parameter from gettext

pull/1373/head
Safihre 5 years ago
parent
commit
b0a50a2eac
  1. 1
      sabnzbd/lang.py
  2. 4
      tools/make_mo.py

1
sabnzbd/lang.py

@ -56,7 +56,6 @@ def set_language(language=None):
if not language:
language = ""
# 'codeset' will determine the output of lgettext
lng = gettext.translation(_DOMAIN, _LOCALEDIR, [language], fallback=True)
builtins.__dict__["T"] = lng.gettext
builtins.__dict__["TT"] = lambda x: str(x) # Use in text tables

4
tools/make_mo.py

@ -211,7 +211,7 @@ def make_templates():
lng = os.path.split(path)[1]
if lng != "en" and os.path.exists(os.path.join(POE_DIR, lng + ".po")):
print(("Create email template for %s" % lng))
trans = gettext.translation(DOMAIN_E, MO_DIR, [lng], fallback=False, codeset="latin-1")
trans = gettext.translation(DOMAIN_E, MO_DIR, [lng], fallback=False)
trans.install(names=["lgettext"])
translate_tmpl("email", lng)
@ -251,7 +251,7 @@ def patch_nsis():
# The language code will be stored in the registry
text_trans = lcode
else:
trans = gettext.translation(DOMAIN_N, MO_DIR, [lcode], fallback=False, codeset="cp1252")
trans = gettext.translation(DOMAIN_N, MO_DIR, [lcode], fallback=False)
trans.install(names=["lgettext"])
text_trans = _(text)
text_trans = text_trans.replace("\r", "").replace("\n", "\\r\\n")

Loading…
Cancel
Save