[gnome-games/gnome-3-0] chess: Correctly set up i18n (Bug #647090)



commit ef85fbe2c5e5d0ea7c344f93e4e48bc80ca1b714
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Apr 8 15:24:39 2011 +1000

    chess: Correctly set up i18n (Bug #647090)

 glchess/src/Makefile.am  |    1 +
 glchess/src/config.vapi  |    1 +
 glchess/src/glchess.vala |    5 +++++
 3 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/glchess/src/Makefile.am b/glchess/src/Makefile.am
index 8dd1bc4..ef78ce9 100644
--- a/glchess/src/Makefile.am
+++ b/glchess/src/Makefile.am
@@ -50,6 +50,7 @@ test_chess_pgn_VALAFLAGS = \
 
 glchess_CFLAGS = \
 	-DPKGDATADIR=\"@datadir@/glchess\" \
+	-DLOCALEDIR=\"@localedir \" \
 	$(GMODULE_CFLAGS) \
 	$(GTK_CFLAGS) \
 	$(GLX_CFLAGS) \
diff --git a/glchess/src/config.vapi b/glchess/src/config.vapi
index f697a31..aae449c 100644
--- a/glchess/src/config.vapi
+++ b/glchess/src/config.vapi
@@ -2,6 +2,7 @@
 namespace Config
 {
   public const string PKGDATADIR;
+  public const string LOCALEDIR;
   public const string GETTEXT_PACKAGE;
   public const string VERSION;
 }
diff --git a/glchess/src/glchess.vala b/glchess/src/glchess.vala
index 033940c..e5d4102 100644
--- a/glchess/src/glchess.vala
+++ b/glchess/src/glchess.vala
@@ -1564,6 +1564,11 @@ class GlChess
 {
     public static int main (string[] args)
     {
+        Intl.setlocale (LocaleCategory.ALL, "");
+        Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
+        Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
+        Intl.textdomain (Config.GETTEXT_PACKAGE);
+
         Gtk.init (ref args);
 
         File? game_file = null;



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