diff --git a/meson.build b/meson.build index 75348b95..c7657a6a 100644 --- a/meson.build +++ b/meson.build @@ -19,6 +19,8 @@ clapper_version_suffix = '-' + version_array[0] + '.0' clapper_api_name = meson.project_name() + clapper_version_suffix +devenv = environment() + gnome = import('gnome') pkgconfig = import('pkgconfig') i18n = import('i18n') @@ -124,6 +126,8 @@ endif subdir('src') subdir('doc') +meson.add_devenv(devenv) + summary({ 'prefix': prefix, 'bindir': bindir, diff --git a/src/bin/clapper-app/main.c b/src/bin/clapper-app/main.c index fe53c76e..cd33040e 100644 --- a/src/bin/clapper-app/main.c +++ b/src/bin/clapper-app/main.c @@ -29,13 +29,16 @@ gint main (gint argc, gchar **argv) { + const gchar *clapper_ldir; GApplication *application; gint status; g_setenv ("GSK_RENDERER", "gl", FALSE); setlocale (LC_ALL, ""); - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + if (!(clapper_ldir = g_getenv ("CLAPPER_APP_OVERRIDE_LOCALEDIR"))) + clapper_ldir = LOCALEDIR; + bindtextdomain (GETTEXT_PACKAGE, clapper_ldir); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); diff --git a/src/bin/clapper-app/meson.build b/src/bin/clapper-app/meson.build index 9e50a7ac..70e9d168 100644 --- a/src/bin/clapper-app/meson.build +++ b/src/bin/clapper-app/meson.build @@ -42,7 +42,7 @@ clapperapp_conf_inc = [ ] config_h = configuration_data() -config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name() + '-gtk') +config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name() + '-app') config_h.set_quoted('LOCALEDIR', join_paths (prefix, localedir)) config_h.set_quoted('CLAPPER_APP_NAME', 'Clapper') config_h.set_quoted('CLAPPER_APP_ID', app_id) diff --git a/src/bin/clapper-app/po/meson.build b/src/bin/clapper-app/po/meson.build index b166bffe..e74e8800 100644 --- a/src/bin/clapper-app/po/meson.build +++ b/src/bin/clapper-app/po/meson.build @@ -1 +1,3 @@ i18n.gettext(meson.project_name() + '-app', preset: 'glib') + +devenv.set('CLAPPER_APP_OVERRIDE_LOCALEDIR', meson.current_build_dir()) diff --git a/src/lib/clapper-gtk/clapper-gtk-utils.c b/src/lib/clapper-gtk/clapper-gtk-utils.c index bc0f3364..89ceb6bf 100644 --- a/src/lib/clapper-gtk/clapper-gtk-utils.c +++ b/src/lib/clapper-gtk/clapper-gtk-utils.c @@ -62,10 +62,14 @@ clapper_gtk_get_player_from_ancestor (GtkWidget *widget) void clapper_gtk_init_translations (void) { + const gchar *clapper_gtk_ldir; + if (initialized) return; - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + if (!(clapper_gtk_ldir = g_getenv ("CLAPPER_GTK_OVERRIDE_LOCALEDIR"))) + clapper_gtk_ldir = LOCALEDIR; + bindtextdomain (GETTEXT_PACKAGE, clapper_gtk_ldir); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); initialized = TRUE; diff --git a/src/lib/clapper-gtk/meson.build b/src/lib/clapper-gtk/meson.build index 8c989a73..0a9db374 100644 --- a/src/lib/clapper-gtk/meson.build +++ b/src/lib/clapper-gtk/meson.build @@ -30,7 +30,7 @@ endforeach subdir('po') config_h = configuration_data() -config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name() + '-app') +config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name() + '-gtk') config_h.set_quoted('LOCALEDIR', join_paths (prefix, localedir)) config_h.set_quoted('CLAPPER_GTK_RESOURCE_PREFIX', clappergtk_resource_prefix) diff --git a/src/lib/clapper-gtk/po/meson.build b/src/lib/clapper-gtk/po/meson.build index 8072d4d9..b4d2dee8 100644 --- a/src/lib/clapper-gtk/po/meson.build +++ b/src/lib/clapper-gtk/po/meson.build @@ -1 +1,3 @@ i18n.gettext(meson.project_name() + '-gtk', preset: 'glib') + +devenv.set('CLAPPER_GTK_OVERRIDE_LOCALEDIR', meson.current_build_dir())