summaryrefslogtreecommitdiff
path: root/m4/as-linguas.m4
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-04-07 04:19:32 +0200
committerP. F. Chimento <philip.chimento@gmail.com>2013-04-17 17:15:52 +0200
commit89671a4914caf1e20ea20a19c6bff7a058ebb3c4 (patch)
treea99b4544f888cfe6b6bbf99c4e0519117d40e89d /m4/as-linguas.m4
parent408f93ec2327a8647030139a2e6f295e8b2c8de1 (diff)
Internationalize the shared library
Add infrastructure for translating the single string in the shared library. [#1]
Diffstat (limited to 'm4/as-linguas.m4')
-rw-r--r--m4/as-linguas.m426
1 files changed, 26 insertions, 0 deletions
diff --git a/m4/as-linguas.m4 b/m4/as-linguas.m4
new file mode 100644
index 0000000..8b4e07f
--- /dev/null
+++ b/m4/as-linguas.m4
@@ -0,0 +1,26 @@
+# Set ALL_LINGUAS based on the .po files present. Optional argument is the
+# name of the po directory. $podir/LINGUAS.ignore can be used to ignore a
+# subset of the po files.
+
+# Public domain, according to Emmanuele
+
+AC_DEFUN([AS_ALL_LINGUAS],
+[
+ AC_MSG_CHECKING([for linguas])
+ podir="m4_default([$1],[$srcdir/po])"
+ linguas=`cd $podir && ls *.po 2>/dev/null | awk 'BEGIN { FS="."; ORS=" " } { print $[]1 }'`
+ if test -f "$podir/LINGUAS.ignore"; then
+ ALL_LINGUAS="";
+ ignore_linguas=`sed -n -e 's/^\s\+\|\s\+$//g' -e '/^#/b' -e '/\S/!b' \
+ -e 's/\s\+/\n/g' -e p "$podir/LINGUAS.ignore"`;
+ for lang in $linguas; do
+ if ! echo "$ignore_linguas" | grep -q "^${lang}$"; then
+ ALL_LINGUAS="$ALL_LINGUAS $lang";
+ fi;
+ done;
+ else
+ ALL_LINGUAS="$linguas";
+ fi;
+ AC_SUBST([ALL_LINGUAS])
+ AC_MSG_RESULT($ALL_LINGUAS)
+])