Merged in default (pull request #449)

Fri, 14 Dec 2018 07:56:29 +0000

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 14 Dec 2018 07:56:29 +0000
changeset 39375
4fa7e9a15bd9
parent 39371
7b1f250e1d41 (current diff)
parent 39374
d6261d7d0c91 (diff)
child 39377
c84d810de0a4

Merged in default (pull request #449)

Make 'nls' option only toggle building po/ and .desktop files

Approved-by: Elliott Sales de Andrade
Approved-by: Gary Kramlich

--- a/doc/reference/libpurple/plugin_i18n.xml	Fri Dec 14 07:49:09 2018 +0000
+++ b/doc/reference/libpurple/plugin_i18n.xml	Fri Dec 14 07:56:29 2018 +0000
@@ -135,10 +135,8 @@
     <listitem><para>
 Now add the following within your 'plugin_load' function:
 <programlisting>
-#ifdef ENABLE_NLS
 	bindtextdomain(GETTEXT_PACKAGE, PURPLE_LOCALEDIR);
 	bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
-#endif /* ENABLE_NLS */
 
 	info.name        = _("&lt;YOUR PLUGIN NAME&gt;");
 	info.summary     = _("&lt;YOUR PLUGIN SUMMARY&gt;");
--- a/finch/libfinch.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/finch/libfinch.c	Fri Dec 14 07:56:29 2018 +0000
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 #include <internal.h>
+#include <locale.h>
 #include "finch.h"
 
 #include "account.h"
@@ -156,11 +157,9 @@
 		{NULL}
 	};
 
-#ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, PURPLE_LOCALEDIR);
 	bind_textdomain_codeset(PACKAGE, "UTF-8");
 	textdomain(PACKAGE);
-#endif
 
 	setlocale(LC_ALL, "");
 
--- a/libpurple/core.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/libpurple/core.c	Fri Dec 14 07:56:29 2018 +0000
@@ -95,9 +95,8 @@
 	g_return_val_if_fail(ui != NULL, FALSE);
 	g_return_val_if_fail(purple_get_core() == NULL, FALSE);
 
-#ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, PURPLE_LOCALEDIR);
-#endif
+
 #ifdef _WIN32
 	wpurple_init();
 #endif
--- a/libpurple/internal.h	Fri Dec 14 07:49:09 2018 +0000
+++ b/libpurple/internal.h	Fri Dec 14 07:56:29 2018 +0000
@@ -36,36 +36,8 @@
 #ifdef SKYOS
 #include <net/sockios.h>
 #endif
-/*
- * If we're using NLS, make sure gettext works.  If not, then define
- * dummy macros in place of the normal gettext macros.
- *
- * Also, the perl XS config.h file sometimes defines _  So we need to
- * make sure _ isn't already defined before trying to define it.
- *
- * The Singular/Plural/Number ngettext dummy definition below was
- * taken from an email to the texinfo mailing list by Manuel Guerrero.
- * Thank you Manuel, and thank you Alex's good friend Google.
- */
-#ifdef ENABLE_NLS
-#  include <locale.h>
-#  include <libintl.h>
-#  undef printf
-#  define _(String) ((const char *)dgettext(PACKAGE, String))
-#  ifdef gettext_noop
-#    define N_(String) gettext_noop (String)
-#  else
-#    define N_(String) (String)
-#  endif
-#else
-#  include <locale.h>
-#  define N_(String) (String)
-#  ifndef _
-#    define _(String) ((const char *)String)
-#  endif
-#  define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
-#  define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
-#endif
+
+#include <glib/gi18n-lib.h>
 
 #ifdef HAVE_ENDIAN_H
 # include <endian.h>
--- a/libpurple/win32/libc_interface.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/libpurple/win32/libc_interface.c	Fri Dec 14 07:56:29 2018 +0000
@@ -21,6 +21,7 @@
 
 #include <config.h>
 
+#include <glib/gi18n-lib.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <io.h>
@@ -37,26 +38,6 @@
 #include <glib/gstdio.h>
 #include "util.h"
 
-/** This is redefined here because we can't include internal.h */
-#ifdef ENABLE_NLS
-#  include <locale.h>
-#  include <libintl.h>
-#  define _(String) ((const char *)dgettext(PACKAGE, String))
-#  ifdef gettext_noop
-#    define N_(String) gettext_noop (String)
-#  else
-#    define N_(String) (String)
-#  endif
-#else
-#  include <locale.h>
-#  define N_(String) (String)
-#  ifndef _
-#    define _(String) ((const char *)String)
-#  endif
-#  define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
-#  define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural))
-#endif
-
 #ifndef S_ISDIR
 # define S_ISDIR(m) (((m)&S_IFDIR)==S_IFDIR)
 #endif
--- a/meson.build	Fri Dec 14 07:49:09 2018 +0000
+++ b/meson.build	Fri Dec 14 07:56:29 2018 +0000
@@ -37,6 +37,7 @@
 purple_h_conf = configuration_data()
 version_conf = configuration_data()
 
+conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
 conf.set_quoted('PACKAGE', meson.project_name())
 conf.set_quoted('PACKAGE_NAME', meson.project_name())
 conf.set_quoted('VERSION', purple_display_version)
@@ -263,8 +264,6 @@
 INSTALL_I18N = get_option('nls')
 
 if INSTALL_I18N
-	conf.set('ENABLE_NLS', true)
-
 	i18n = import('i18n')
 
 	subdir('po')
--- a/pidgin/gtkblist.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/pidgin/gtkblist.c	Fri Dec 14 07:56:29 2018 +0000
@@ -5782,9 +5782,7 @@
 
 	/******************************* Menu bar *************************************/
 	action_group = gtk_action_group_new("BListActions");
-#ifdef ENABLE_NLS
 	gtk_action_group_set_translation_domain(action_group, PACKAGE);
-#endif
 	gtk_action_group_add_actions(action_group,
 	                             blist_menu_entries,
 	                             G_N_ELEMENTS(blist_menu_entries),
@@ -8188,9 +8186,8 @@
 	}
 
 	plugins_action_group = gtk_action_group_new("PluginActions");
-#ifdef ENABLE_NLS
 	gtk_action_group_set_translation_domain(plugins_action_group, PACKAGE);
-#endif
+
 	plugins_ui = g_string_new(NULL);
 
 	/* Add a submenu for each plugin with custom actions */
@@ -8263,9 +8260,8 @@
 	}
 
 	sort_action_group = gtk_action_group_new("SortMethods");
-#ifdef ENABLE_NLS
 	gtk_action_group_set_translation_domain(sort_action_group, PACKAGE);
-#endif
+
 	ui_string = g_string_new("<ui><menubar name='BList'>"
 	                         "<menu action='BuddiesMenu'><menu action='SortMenu'>");
 
--- a/pidgin/gtkconv.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/pidgin/gtkconv.c	Fri Dec 14 07:56:29 2018 +0000
@@ -3598,9 +3598,7 @@
 	GtkWidget *menuitem;
 
 	action_group = gtk_action_group_new("ConversationActions");
-#ifdef ENABLE_NLS
 	gtk_action_group_set_translation_domain(action_group, PACKAGE);
-#endif
 	gtk_action_group_add_actions(action_group,
 	                             menu_entries,
 	                             G_N_ELEMENTS(menu_entries),
--- a/pidgin/gtkmedia.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/pidgin/gtkmedia.c	Fri Dec 14 07:56:29 2018 +0000
@@ -288,10 +288,7 @@
 	GtkWidget *menu;
 
 	window->priv->ui = gtk_builder_new();
-
-#ifdef ENABLE_NLS
 	gtk_builder_set_translation_domain(window->priv->ui, PACKAGE);
-#endif
 
 	error = NULL;
 	if (!gtk_builder_add_from_string(window->priv->ui, media_menu, -1,
--- a/pidgin/gtkwebviewtoolbar.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/pidgin/gtkwebviewtoolbar.c	Fri Dec 14 07:56:29 2018 +0000
@@ -1404,9 +1404,7 @@
 	};
 
 	action_group = gtk_action_group_new("PidginWebViewToolbar");
-#ifdef ENABLE_NLS
 	gtk_action_group_set_translation_domain(action_group, PACKAGE);
-#endif
 
 	for (i = 0; i < G_N_ELEMENTS(actions); i++) {
 		GtkAction *action;
--- a/pidgin/libpidgin.c	Fri Dec 14 07:49:09 2018 +0000
+++ b/pidgin/libpidgin.c	Fri Dec 14 07:56:29 2018 +0000
@@ -21,6 +21,7 @@
  *
  */
 
+#include <locale.h>
 #include "internal.h"
 #include "pidgin.h"
 
@@ -717,11 +718,9 @@
 	purple_debug_set_enabled(TRUE);
 #endif
 
-#ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, PURPLE_LOCALEDIR);
 	bind_textdomain_codeset(PACKAGE, "UTF-8");
 	textdomain(PACKAGE);
-#endif
 
 	/* Locale initialization is not complete here.  See gtk_init_check() */
 	setlocale(LC_ALL, "");

mercurial