[gnome-builder] meson-templates: use locale module in Python



commit 697b4aba34d17a5635db16d6a796c95faf14eb7c
Author: oscfdezdz <oscfdezdz tuta io>
Date:   Sun Feb 13 20:31:15 2022 +0100

    meson-templates: use locale module in Python
    
    Fixes translations not showing up when running an app build with Python GTK3/4 templates.

 src/plugins/meson-templates/resources/src/hello.py.in | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/plugins/meson-templates/resources/src/hello.py.in 
b/src/plugins/meson-templates/resources/src/hello.py.in
index c9a7e9c82..5d68b4f3a 100644
--- a/src/plugins/meson-templates/resources/src/hello.py.in
+++ b/src/plugins/meson-templates/resources/src/hello.py.in
@@ -5,6 +5,7 @@
 import os
 import sys
 import signal
+import locale
 import gettext
 
 VERSION = '@VERSION@'
@@ -13,6 +14,8 @@ localedir = '@localedir@'
 
 sys.path.insert(1, pkgdatadir)
 signal.signal(signal.SIGINT, signal.SIG_DFL)
+locale.bindtextdomain('{{name}}', localedir)
+locale.textdomain('{{name}}')
 gettext.install('{{name}}', localedir)
 
 if __name__ == '__main__':


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]