diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-09-06 14:32:16 +0100 |
---|---|---|
committer | Travis Reitter <travis.reitter@collabora.co.uk> | 2010-11-04 09:21:00 -0700 |
commit | affa69029fe409b60de0fdf1bef7429c51c2907b (patch) | |
tree | 5c4c5e39dad57232a12679dc15e5a58c42193723 | |
parent | aaad9438b2d949b3c4ef6fad3d3821b873655089 (diff) |
Bug 628883 — Add localisation support
Add gettext/intltool build system support, but don't mark any strings for
translation yet. Helps: bgo#628883
-rw-r--r-- | Makefile.am | 1 | ||||
-rwxr-xr-x | autogen.sh | 2 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | folks/build-conf.vapi | 6 | ||||
-rw-r--r-- | po/LINGUAS | 0 | ||||
-rw-r--r-- | po/POTFILES.in | 0 | ||||
-rw-r--r-- | po/POTFILES.skip | 0 | ||||
-rw-r--r-- | tools/Makefile.am | 6 | ||||
-rw-r--r-- | tools/import.vala | 3 |
9 files changed, 30 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 5f0a32a..dc8f8b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index d748a89..7dc8135 100644 --- a/configure.ac +++ b/configure.ac @@ -149,6 +149,17 @@ AS_IF([test "x$enable_docs" != xno], [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 diff --git a/folks/build-conf.vapi b/folks/build-conf.vapi index 41793c7..82c36c3 100644 --- a/folks/build-conf.vapi +++ b/folks/build-conf.vapi @@ -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; } diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/po/LINGUAS diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/po/POTFILES.in diff --git a/po/POTFILES.skip b/po/POTFILES.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/po/POTFILES.skip diff --git a/tools/Makefile.am b/tools/Makefile.am index a538a99..17ab8e7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -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 = \ diff --git a/tools/import.vala b/tools/import.vala index 451290f..7e060c3 100644 --- a/tools/import.vala +++ b/tools/import.vala @@ -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"); |