Commit 2bb7d64e authored by Michael Tremer's avatar Michael Tremer

Add internationalisation with intltool and gettext

Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 774eea26
......@@ -3,6 +3,8 @@ CLEANFILES =
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
SUBDIRS = . po
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
......@@ -36,6 +38,12 @@ pkgconfigdir = $(libdir)/pkgconfig
%: %.in Makefile
$(SED_PROCESS)
@INTLTOOL_POLICY_RULE@
.PHONY: update-po
update-po:
$(MAKE) -C po update-po
EXTRA_DIST += \
examples/python/create-database.py \
examples/python/read-database.py
......
......@@ -8,6 +8,7 @@ if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
echo "Activated pre-commit hook."
fi
intltoolize --force --automake
autoreconf --install --symlink
libdir() {
......
......@@ -29,6 +29,10 @@ LT_INIT([
])
AC_PREFIX_DEFAULT([/usr])
IT_PROG_INTLTOOL([0.40.0])
GETTEXT_PACKAGE=${PACKAGE_TARNAME}
AC_SUBST(GETTEXT_PACKAGE)
AC_PROG_SED
AC_PROG_MKDIR_P
......@@ -82,6 +86,7 @@ PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
Makefile
po/Makefile.in
])
AC_OUTPUT
......
intltool.m4
libtool.m4
ltoptions.m4
ltsugar.m4
......
/POTFILES
/Makefile.in.in
/.intltool-merge-cache
/Makefile
/stamp-it
*.pot
# nothing, yet
src/python/location-query.in
......@@ -18,6 +18,7 @@
###############################################################################
import argparse
import gettext
import sys
import syslog
......@@ -25,7 +26,11 @@ import syslog
import location
# i18n
_ = lambda x: x
def _(singular, plural=None, n=None):
if plural:
return gettext.dngettext("libloc", singular, plural, n)
return gettext.dgettext("libloc", singular)
class CLI(object):
def __init__(self):
......
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