mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
aurweb.l10n: Translate without side effects
The install method in Python’s gettext API aliases the translator’s gettext method to an application-global _(). We don’t use that anywhere, and it’s clear from aurweb’s Translator interface that we want to translate a piece of text without affecting any global namespace. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
2b439b8199
commit
3f31d149a6
1 changed files with 1 additions and 2 deletions
|
@ -15,5 +15,4 @@ class Translator:
|
|||
self._translator[lang] = gettext.translation("aurweb",
|
||||
self._localedir,
|
||||
languages=[lang])
|
||||
self._translator[lang].install()
|
||||
return _(s) # _ is not defined, what is this? # noqa: F821
|
||||
return self._translator[lang].gettext(s)
|
||||
|
|
Loading…
Add table
Reference in a new issue