summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Mangano-Tarumi <fmang@mg0.fr>2020-06-09 20:25:22 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2021-02-20 17:24:30 +0100
commit3f31d149a6dd736007c6583a6162aeda1bcc37b8 (patch)
treec5fb97e8d9b9321aa11b9be07142ed1db69c7a9a
parent2b439b819908a7f6e9cbd9029d82de617230312f (diff)
downloadaur-3f31d149a6dd736007c6583a6162aeda1bcc37b8.tar.gz
aur-3f31d149a6dd736007c6583a6162aeda1bcc37b8.tar.xz
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>
-rw-r--r--aurweb/l10n.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/aurweb/l10n.py b/aurweb/l10n.py
index 492200b3..51b56abb 100644
--- a/aurweb/l10n.py
+++ b/aurweb/l10n.py
@@ -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)