Commit 3f31d149 authored by Frédéric Mangano-Tarumi's avatar Frédéric Mangano-Tarumi Committed by Lukas Fleischer
Browse files

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's avatarLukas Fleischer <>
parent 2b439b81
...@@ -15,5 +15,4 @@ class Translator: ...@@ -15,5 +15,4 @@ class Translator:
self._translator[lang] = gettext.translation("aurweb", self._translator[lang] = gettext.translation("aurweb",
self._localedir, self._localedir,
languages=[lang]) languages=[lang])
self._translator[lang].install() return self._translator[lang].gettext(s)
return _(s) # _ is not defined, what is this? # noqa: F821
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment