[gnome-control-center] common: Add list-languages test application



commit c95e8b22f6983dd8c98e520c1558d00fe747d52c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Aug 16 18:06:48 2011 +0100

    common: Add list-languages test application
    
    Would just list the supported languages, and makes it easier
    to debug the absence of a language.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=656338

 panels/common/Makefile.am      |    5 +++++
 panels/common/list-languages.c |   25 +++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/panels/common/Makefile.am b/panels/common/Makefile.am
index eadb5c6..6f9790f 100644
--- a/panels/common/Makefile.am
+++ b/panels/common/Makefile.am
@@ -2,6 +2,7 @@
 cappletname = common
 
 noinst_LTLIBRARIES = liblanguage.la libshortcuts.la
+noinst_PROGRAMS = list-languages
 
 AM_CPPFLAGS =						\
 	$(PANEL_CFLAGS)					\
@@ -35,4 +36,8 @@ libshortcuts_la_LIBADD =		\
 
 libshortcuts_la_LDFLAGS = $(PANEL_LDFLAGS)
 
+list_languages_SOURCES = list-languages.c
+list_languages_LDADD = liblanguage.la
+list_languages_CFLAGS = $(LIBLANGUAGE_CFLAGS)
+
 -include $(top_srcdir)/git.mk
diff --git a/panels/common/list-languages.c b/panels/common/list-languages.c
new file mode 100644
index 0000000..592d430
--- /dev/null
+++ b/panels/common/list-languages.c
@@ -0,0 +1,25 @@
+#include <glib.h>
+#include <glib-object.h>
+#include "gdm-languages.h"
+
+int main (int argc, char **argv)
+{
+	char **langs;
+	guint i;
+
+	g_type_init ();
+
+	langs = gdm_get_all_language_names ();
+	if (langs == NULL) {
+		g_warning ("No languages found");
+		return 1;
+	}
+
+	for (i = 0; langs[i] != NULL; i++)
+		g_print ("%s == %s\n", langs[i], gdm_get_language_from_name (langs[i], NULL));
+
+	g_strfreev (langs);
+
+	return 0;
+}
+



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