pidgin/purple-plugin-pack

Add internationalization bits to Meson build.
meson
2017-06-23, Elliott Sales de Andrade
2a5672f7cb7e
Parents 35b42e5ed347
Children 8615fc119de6
Add internationalization bits to Meson build.
--- a/hideconv/hideconv.c Fri Jun 23 17:48:33 2017 -0400
+++ b/hideconv/hideconv.c Fri Jun 23 18:10:52 2017 -0400
@@ -279,7 +279,7 @@
static void
init_plugin(PurplePlugin *plugin) {
#ifdef ENABLE_NLS
- bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+ bindtextdomain(GETTEXT_PACKAGE, PP_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */
--- a/ignorance/ignorance.c Fri Jun 23 17:48:33 2017 -0400
+++ b/ignorance/ignorance.c Fri Jun 23 18:10:52 2017 -0400
@@ -1195,8 +1195,8 @@
ignorance_init (PurplePlugin * plugin)
{
#ifdef ENABLE_NLS
- bindtextdomain(PP_PACKAGE, PP_LOCALEDIR);
- bind_textdomain_codeset(PP_PACKAGE, "UTF-8");
+ bindtextdomain(GETTEXT_PACKAGE, PP_LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */
ig_info.name = _("Ignorance");
--- a/meson.build Fri Jun 23 17:48:33 2017 -0400
+++ b/meson.build Fri Jun 23 18:10:52 2017 -0400
@@ -15,12 +15,10 @@
#######################################################################
# Good ol' gettext
#######################################################################
-#AC_PROG_INTLTOOL
GETTEXT_PACKAGE = 'plugin_pack'
conf.set_quoted('GETTEXT_PACKAGE', GETTEXT_PACKAGE)
ALL_LINGUAS = 'de en_AU es_ES fr vi'.split()
-#AM_GLIB_GNU_GETTEXT
#######################################################################
# Look for the C compiler
@@ -48,10 +46,7 @@
PURPLE_LIBDIR = PURPLE.get_pkgconfig_variable('plugindir')
PURPLE_DATADIR = PURPLE.get_pkgconfig_variable('datadir')
-# this is a hack but should work fine.
-# we use the libpurple datadir for PP_LOCALEDIR since we are not breaking up
-# the pot's yet, and need to make sure they goto the same place
-PP_LOCALEDIR = join_paths(PURPLE_DATADIR, 'locale')
+PP_LOCALEDIR = join_paths(get_option('prefix'), get_option('localedir'))
conf.set_quoted('PP_LOCALEDIR', PP_LOCALEDIR)
#######################################################################
@@ -157,6 +152,8 @@
# Disable installation of translation files
#######################################################################
INSTALL_I18N = get_option('nls')
+subdir('po')
+conf.set('ENABLE_NLS', INSTALL_I18N)
#######################################################################
# Add all plugin directories:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/po/meson.build Fri Jun 23 18:10:52 2017 -0400
@@ -0,0 +1,3 @@
+i18n = import('i18n')
+
+i18n.gettext(GETTEXT_PACKAGE, languages : ALL_LINGUAS)