summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-06-30 14:57:21 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-06-30 14:57:21 +0100
commit7f5122fc2393701b49a8118b342775c18e11d8f5 (patch)
tree0a2c6ca8a1ff4eeb16ceeec7137c376ce64ddaa9
parent26bc7a58fb2099b4a6f50c55cb67b65ce324eb06 (diff)
Check for libintl.h and add haze_get_fallback_group()
This returns _("Buddies") in Pidgin's text domain, to match the default group name that most prpls use. Also run Haze under LC_ALL=C for the tests, so we always get it untranslated there.
-rw-r--r--configure.ac2
-rw-r--r--src/connection.c15
-rw-r--r--src/connection.h2
-rwxr-xr-xtests/exec-with-log.sh1
4 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f5ceeba..cf40557 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,8 @@ TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test x$release = xno],
unused-parameter])
AC_SUBST(ERROR_CFLAGS)
+AC_CHECK_HEADERS_ONCE([libintl.h])
+
AC_ARG_ENABLE(leaky-request-stubs,
AC_HELP_STRING([--enable-leaky-request-stubs],[print debugging information when libpurple attempts to use the request API (warning: very leaky)]),
AC_DEFINE(ENABLE_LEAKY_REQUEST_STUBS, [], [Enable the leaky stub implementation of the request API for debugging purposes]))
diff --git a/src/connection.c b/src/connection.c
index 93f8eba..93bbaec 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -47,6 +47,12 @@
#include "connection-capabilities.h"
+#ifdef HAVE_LIBINTL_H
+# include <libintl.h>
+#else
+# define dgettext(domain, msgid) (msgid)
+#endif
+
enum
{
PROP_PARAMETERS = 1,
@@ -777,3 +783,12 @@ haze_connection_handle_inspect (HazeConnection *conn,
g_assert (tp_handle_is_valid (handle_repo, handle, NULL));
return tp_handle_inspect (handle_repo, handle);
}
+
+/**
+ * Get the group that "most" libpurple prpls will use for ungrouped contacts.
+ */
+const gchar *
+haze_get_fallback_group (void)
+{
+ return dgettext ("pidgin", "Buddies");
+}
diff --git a/src/connection.h b/src/connection.h
index 630f48e..5166cdc 100644
--- a/src/connection.h
+++ b/src/connection.h
@@ -114,6 +114,8 @@ GType haze_connection_get_type (void);
(G_TYPE_INSTANCE_GET_CLASS ((obj), HAZE_TYPE_CONNECTION, \
HazeConnectionClass))
+const gchar *haze_get_fallback_group (void);
+
G_END_DECLS
#endif /* #ifndef __HAZE_CONNECTION_H__*/
diff --git a/tests/exec-with-log.sh b/tests/exec-with-log.sh
index abfff63..fe25b3c 100755
--- a/tests/exec-with-log.sh
+++ b/tests/exec-with-log.sh
@@ -7,6 +7,7 @@ shift
cd "${abs_top_builddir}/tests"
+export LC_ALL=C
export HAZE_DEBUG=all
ulimit -c unlimited
exec >> haze-testing.log 2>&1