Commit affa6902 authored by Philip Withnall's avatar Philip Withnall Committed by Travis Reitter
Browse files

Bug 628883 — Add localisation support

Add gettext/intltool build system support, but don't mark any strings for
translation yet. Helps: bgo#628883
parent aaad9438
......@@ -5,6 +5,7 @@ SUBDIRS = \
backends \
tests \
tools \
po \
$(NULL)
if ENABLE_DOCS
......
......@@ -15,6 +15,8 @@ elif automake-1.11 --version >/dev/null 2>/dev/null && \
fi
autoreconf -i -f
autopoint --force || exit $?
intltoolize --force --copy --automake
run_configure=true
for arg in $*; do
......
......@@ -148,6 +148,17 @@ AS_IF([test "x$enable_docs" != xno],
AS_IF([test "$VALADOC" = :],
[AC_MSG_ERROR([valadoc not found])])])
# -----------------------------------------------------------
# Gettext
# -----------------------------------------------------------
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])
IT_PROG_INTLTOOL([0.35.0])
# -----------------------------------------------------------
# Error flags
# -----------------------------------------------------------
......@@ -218,6 +229,7 @@ AC_CONFIG_FILES([
backends/telepathy/lib/Makefile
folks/Makefile
docs/Makefile
po/Makefile.in
tests/Makefile
tests/folks/Makefile
tests/key-file/Makefile
......
......@@ -38,4 +38,10 @@ public class Folks.BuildConf
[CCode (cname = "PACKAGE_STRING")]
public static const string PACKAGE_STRING;
[CCode (cname = "GETTEXT_PACKAGE")]
public static const string GETTEXT_PACKAGE;
[CCode (cname = "LOCALE_DIR")]
public static const string LOCALE_DIR;
}
......@@ -2,11 +2,17 @@ if ENABLE_IMPORT_TOOL
bin_PROGRAMS = folks-import
endif
AM_CPPFLAGS = \
-include $(CONFIG_HEADER) \
-DLOCALE_DIR=\"$(pkgdatadir)/locale\" \
$(NULL)
VALAFLAGS = \
--vapidir=$(top_builddir)/folks \
--pkg=gee-1.0 \
--pkg=libxml-2.0 \
--pkg=folks \
--pkg=build-conf \
$(NULL)
folks_import_SOURCES = \
......
......@@ -48,6 +48,9 @@ public class Folks.ImportTool : Object
public static int main (string[] args)
{
Intl.bindtextdomain (BuildConf.GETTEXT_PACKAGE, BuildConf.LOCALE_DIR);
Intl.textdomain (BuildConf.GETTEXT_PACKAGE);
OptionContext context = new OptionContext ("— import meta-contact " +
"information to libfolks");
context.add_main_entries (ImportTool.options, "folks");
......
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