[Pkg-privacy-commits] [tails-installer] 05/17: Translate to UTF-8 encoded strings everywhere.
Ulrike Uhlig
ulrike at moszumanska.debian.org
Mon Mar 12 14:21:14 UTC 2018
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to branch tails/master
in repository tails-installer.
commit 8d63a4ca1e192980e2e481f4b9b45c26867f3d3d
Author: anonym <anonym at riseup.net>
Date: Sat Jan 27 11:15:16 2018 +0100
Translate to UTF-8 encoded strings everywhere.
GtkBuilder's translatable strings (those we give in the .ui file)
results in type str but ugettext() returns the type 'unicode'. unicode
and str objects that represent the same string is not equal under ==,
causing problems in situations where strings from both of these two
sources are compared. So let's be consistent and use UTF-8 encoded
strings everywhere.
---
tails_installer/__init__.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tails_installer/__init__.py b/tails_installer/__init__.py
index 33ce357..86ccf7b 100644
--- a/tails_installer/__init__.py
+++ b/tails_installer/__init__.py
@@ -33,12 +33,13 @@ if os.path.exists('/usr/sbin') or os.path.exists('/usr/local/sbin'):
except KeyError, e:
os.environ['PATH'] = '/usr/local/sbin:/usr/sbin'
-_ = gettext.translation('tails-installer', '/usr/share/locale',
- fallback=True).ugettext
-
-def utf8_gettext(string):
+def utf8_gettext(*args, **kwargs):
" Translate string, converting it to a UTF-8 encoded bytestring "
- return _(string).encode('utf8')
+ return gettext.translation(
+ 'tails-installer', '/usr/share/locale', fallback=True
+ ).gettext(*args, **kwargs)
+
+_ = utf8_gettext
from tails_installer.creator import TailsInstallerError
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list