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
This commit is contained in:
parent
ea686a2355
commit
c95e8b22f6
2 changed files with 30 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
cappletname = common
|
cappletname = common
|
||||||
|
|
||||||
noinst_LTLIBRARIES = liblanguage.la libshortcuts.la
|
noinst_LTLIBRARIES = liblanguage.la libshortcuts.la
|
||||||
|
noinst_PROGRAMS = list-languages
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
$(PANEL_CFLAGS) \
|
$(PANEL_CFLAGS) \
|
||||||
|
@ -35,4 +36,8 @@ libshortcuts_la_LIBADD = \
|
||||||
|
|
||||||
libshortcuts_la_LDFLAGS = $(PANEL_LDFLAGS)
|
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
|
-include $(top_srcdir)/git.mk
|
||||||
|
|
25
panels/common/list-languages.c
Normal file
25
panels/common/list-languages.c
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue