mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
deprecated global _/ngettext was returning None
the plurals may still be wrong in the ngettext case, but at least it should not lead to premature tracebacks
This commit is contained in:
parent
594095f332
commit
f9f5d9d3ab
1 changed files with 2 additions and 1 deletions
|
@ -137,9 +137,10 @@ def setupLang(pm, app, force=None):
|
||||||
# gettext
|
# gettext
|
||||||
_gtrans = gettext.translation(
|
_gtrans = gettext.translation(
|
||||||
'anki', dir, languages=[lang], fallback=True)
|
'anki', dir, languages=[lang], fallback=True)
|
||||||
def fn(*args):
|
def fn(arg, *args):
|
||||||
print("accessing _ and ngettext without importing from anki.lang will break in the future")
|
print("accessing _ and ngettext without importing from anki.lang will break in the future")
|
||||||
print("".join(traceback.format_stack()[-2]))
|
print("".join(traceback.format_stack()[-2]))
|
||||||
|
return arg
|
||||||
builtins.__dict__['_'] = fn
|
builtins.__dict__['_'] = fn
|
||||||
builtins.__dict__['ngettext'] = fn
|
builtins.__dict__['ngettext'] = fn
|
||||||
anki.lang.setLang(lang, local=False)
|
anki.lang.setLang(lang, local=False)
|
||||||
|
|
Loading…
Reference in a new issue