[gtk-vnc] Ensure gvnccapture calls bindtextdomain to setup localization
- From: Daniel P. Berrange <dberrange src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-vnc] Ensure gvnccapture calls bindtextdomain to setup localization
- Date: Fri, 9 Dec 2011 17:42:15 +0000 (UTC)
commit 2e4f1f3a46dbfe59ff05e0d78ef33e834d96e48b
Author: Daniel P. Berrange <berrange redhat com>
Date: Fri Dec 9 17:02:22 2011 +0000
Ensure gvnccapture calls bindtextdomain to setup localization
tools/Makefile.am | 1 +
tools/gvnccapture.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/tools/Makefile.am b/tools/Makefile.am
index ac0c413..62ca302 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -16,6 +16,7 @@ gvnccapture_LDADD = \
$(GOBJECT_LIBS) \
$(GDK_PIXBUF_LIBS)
gvnccapture_CFLAGS = \
+ -DPACKAGE_LOCALE_DIR=\""$(datadir)/locale"\" \
$(GOBJECT_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
$(WARNING_CFLAGS) \
diff --git a/tools/gvnccapture.c b/tools/gvnccapture.c
index 90febe3..90ae8d4 100644
--- a/tools/gvnccapture.c
+++ b/tools/gvnccapture.c
@@ -466,6 +466,19 @@ int main(int argc, char **argv)
};
struct GVncCapture *capture;
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+ if (!bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR)) {
+ perror("bindtextdomain");
+ return EXIT_FAILURE;
+ }
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
+ return EXIT_FAILURE;
+ }
+
g_type_init();
/* Setup command line options */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]