From 3f31d149a6dd736007c6583a6162aeda1bcc37b8 Mon Sep 17 00:00:00 2001 From: Frédéric Mangano-Tarumi Date: Tue, 9 Jun 2020 20:25:22 +0200 Subject: aurweb.l10n: Translate without side effects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- aurweb/l10n.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'aurweb/l10n.py') 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) -- cgit v1.2.3-24-g4f1b