Commit 75838845 authored by Christian Hergert's avatar Christian Hergert

demo: setup gettext during startup

The peas-demo app needs to call setlocale(), bind_textdomain_codeset(),
and textdomain() like a normal application to improve testing of
translations.

Related !24

Fixes #35
parent ec20d0fa
Pipeline #144850 passed with stages
in 6 minutes and 21 seconds
......@@ -106,6 +106,15 @@ main (int argc,
gchar *plugin_dir;
PeasEngine *engine;
setlocale (LC_ALL, "");
/* Normally, we'd need to call bindtextdomain() here. But that would require
* access to the dynamic peas_dirs_get_locale_dir() which is not available
* via the ABI. However, libpeas has a static constructor for it so we do
* not need to call it anyway.
*/
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
option_context = g_option_context_new (_("— libpeas demo application"));
g_option_context_add_main_entries (option_context, demo_args, GETTEXT_PACKAGE);
g_option_context_add_group (option_context, gtk_get_option_group (TRUE));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment