[gupnp-dlna] Call setlocale in main function of gupnp-dlna-info and gupnp-dlna-ls-profiles



commit 9b0783d3fe5264e7fb7d58b65158aa86b0c8092a
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Mon Jan 11 14:25:35 2016 +0800

    Call setlocale in main function of gupnp-dlna-info and gupnp-dlna-ls-profiles
    
    It is required to correctly show translated messages on some locales.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760431

 tools/gupnp-dlna-info.c        |    3 +++
 tools/gupnp-dlna-ls-profiles.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/tools/gupnp-dlna-info.c b/tools/gupnp-dlna-info.c
index 6fabafa..18a45b2 100644
--- a/tools/gupnp-dlna-info.c
+++ b/tools/gupnp-dlna-info.c
@@ -31,6 +31,7 @@
 #include "config.h"
 #endif
 
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -249,6 +250,8 @@ main (int argc,
         g_type_init ();
 #endif
 
+        setlocale (LC_ALL, "");
+
         ctx = g_option_context_new (" - program to extract DLNA and related metadata");
         g_option_context_add_main_entries (ctx, options, NULL);
 
diff --git a/tools/gupnp-dlna-ls-profiles.c b/tools/gupnp-dlna-ls-profiles.c
index 09f3a76..22b9924 100644
--- a/tools/gupnp-dlna-ls-profiles.c
+++ b/tools/gupnp-dlna-ls-profiles.c
@@ -27,6 +27,7 @@
 #include "config.h"
 #endif
 
+#include <locale.h>
 #include <stdlib.h>
 
 #include <glib.h>
@@ -65,6 +66,8 @@ main (int argc, char **argv)
         g_type_init ();
 #endif
 
+        setlocale (LC_ALL, "");
+
         ctx = g_option_context_new (" - program to list all the DLNA profiles supported by gupnp-dlna");
         g_option_context_add_main_entries (ctx, options, NULL);
         if (!g_option_context_parse (ctx, &argc, &argv, &err)) {


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