[kupfer] main: Call locale.bind_textdomain_codeset
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] main: Call locale.bind_textdomain_codeset
- Date: Tue, 27 Oct 2009 17:21:40 +0000 (UTC)
commit 2468d2e8e9bf30cb1bb652365b3b72b31df98e2c
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Oct 27 18:12:49 2009 +0100
main: Call locale.bind_textdomain_codeset
For gtk.Builder, we need to call the C library gettext functions
As well as set the codeset to avoid locale-dependent translation
of the message catalog.
This means that all gettext message catalogs for kupfer need to be
UTF-8, since this is hardcoded at this point. Only the gtk.Builder
interface parts depend on this.
kupfer/main.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/main.py b/kupfer/main.py
index f01c0e8..910d5c0 100644
--- a/kupfer/main.py
+++ b/kupfer/main.py
@@ -19,8 +19,11 @@ def setup_locale_and_gettext():
# also install ngettext()
gettext.install(package_name, localedir=localedir, unicode=True,
names=("ngettext",))
- # also bind this for gtkbuilder (wtf?)
+ # For gtk.Builder, we need to call the C library gettext functions
+ # As well as set the codeset to avoid locale-dependent translation
+ # of the message catalog
locale.bindtextdomain(package_name, localedir)
+ locale.bind_textdomain_codeset(package_name, "UTF-8")
# to load in current locale properly for sorting etc
try:
locale.setlocale(locale.LC_ALL, "")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]