]> git.draconx.ca Git - dxcommon.git/blobdiff - m4/linguas.m4
Fix multiple language substitution in DX_LINGUAS.
[dxcommon.git] / m4 / linguas.m4
index 61613b6dc2f2c42c610ca2ca662971a2cf746ab7..c6ad9736ab5bbfbbcb62d1a5310d8170c47410ac 100644 (file)
@@ -38,25 +38,21 @@ if test -f "$srcdir/po/LINGUAS"; then
     } | sort -u >conftest.ena
   fi
 
-  ALL_LINGUAS=`cat conftest.all`
-  LINGUAS=`join conftest.ena conftest.all`
-
-  # Note: $srcdir is not used here because these variables are for make.
-  set x $ALL_LINGUAS; shift
-  case ${#} in
-  0) ;;
-  *) POFILES=`printf "po/%s.po\n" "${@}"` ;;
-  esac
+  exec 3<conftest.all
+  while read x <&3; do
+    AS_VAR_APPEND([POFILES], ["${POFILES:+ }po/$x.po"])
+  done
 
   if test x"$USE_NLS" = x"yes"; then
-    set x $LINGUAS; shift
-    case ${#} in
-    0) ;;
-    *) MOFILES=`printf "po/%s.mo\n" "${@}"` ;;
-    esac
+    join conftest.ena conftest.all >conftest.out
+    exec 3<conftest.out
+    while read x <&3; do
+      AS_VAR_APPEND([MOFILES], ["${MOFILES:+ }po/$x.mo"])
+    done
   fi
 
-  rm -f conftest.all conftest.ena
+  exec 3<&-
+  rm -f conftest.all conftest.ena conftest.out
 fi
 
 AC_SUBST([POFILES])