diff options
author | Vit Mojzis <vmojzis@redhat.com> | 2022-05-06 16:06:23 +0200 |
---|---|---|
committer | James Carter <jwcart2@gmail.com> | 2022-05-16 10:29:54 -0400 |
commit | b14d5de5b495d8eb83554334041631e4ea29cdbd (patch) | |
tree | 64ac73cfe7490559690da48cba2881fd25243c0f /sandbox | |
parent | 88d43a8dc2786aa45b1aa23b1dbc0551dd1e7de4 (diff) | |
download | selinux-b14d5de5b495d8eb83554334041631e4ea29cdbd.tar.gz |
gettext: set _ on module level instead of builtins namespace
Some calls to "_" where unsuccessful because the function was
initialized with a different translation domain than the string.
e.g. selinux-polgengui calls functions from sepolicy.generate, which end
up printing untranslated strings because polgengui uses selinux-gui
domain while sepolicy uses selinux-python
- Set "_" in module namespace instead of "builtins"
- Set the whole "sepolicy.generate()" confirmation as translatable
- Drop "codeset" parameter since it is deprecated
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
Acked-by: James Carter <jwcart2@gmail.com>
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/sandbox | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sandbox/sandbox b/sandbox/sandbox index 16c43b51..cd5709fb 100644 --- a/sandbox/sandbox +++ b/sandbox/sandbox @@ -43,10 +43,10 @@ try: kwargs = {} if sys.version_info < (3,): kwargs['unicode'] = True - gettext.install(PROGNAME, + t = gettext.translation(PROGNAME, localedir="/usr/share/locale", - codeset='utf-8', **kwargs) + _ = t.gettext except: try: import builtins |