branch: master
commit 6fe08b749e5d2123108b1f5b0cc424274041922e
Author: Kai Sterker <[email protected]>
Commit: Kai Sterker <[email protected]>
FIXED label size not adjusted properly after changing option value
FIXED display of language names containing non-ASCII characters
---
scripts/modules/option_screen.py | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/scripts/modules/option_screen.py b/scripts/modules/option_screen.py
index 1b2c885..c96e3d1 100644
--- a/scripts/modules/option_screen.py
+++ b/scripts/modules/option_screen.py
@@ -13,6 +13,10 @@
#
import adonthell
+import codecs
+
+# -- properly encode unicode strings across python versions
+def u(x): return codecs.unicode_escape_decode(x)[0]
# -- pygettext support
def _(message): return adonthell.nls_translate (message)
@@ -28,14 +32,17 @@ class option_screen (adonthell.win_container):
# Default will try to use the system language
# English is the builtin language, so uses the C locale
# Others are the actual translations that are included
+
+ # note that for the language we always try to display
+ # the native form, which requires escaping any unicode
+ # characters and also fooling xgettext by splitting the
+ # actual unicode literals in 2 halves
self.languages = [ \
("", _("Default")), \
("C", "English"), \
("da_DA", "Dansk"), \
- # ("es_ES", "Espa\xf1ol"), \
- # ("fr_FR", "Fran\xe7ais"), \
- ("es_ES", "Espanol"), \
- ("fr_FR", "Francais"), \
+ ("es_ES", u("Espa\\"+"xf1ol")), \
+ ("fr_FR", u("Fran\\"+"xe7ais")), \
("it_IT", "Italiano"), \
("nl_NL", "Nederlands")]
@@ -231,4 +238,5 @@ class option_screen (adonthell.win_container):
if label != None:
label.move (100 + (80 - label.length())//2, 0)
-
\ No newline at end of file
+ label.pack()
+
\ No newline at end of file
_______________________________________________
Adonthell-commits mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/adonthell-commits