From 06a5d652491166ff04f44a46e0f330be82233287 Mon Sep 17 00:00:00 2001 From: papoteur-mga Date: Thu, 3 Oct 2013 20:52:22 +0200 Subject: Add function to specify a language on the command line. --- tools/po-compile.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/po-compile.sh b/tools/po-compile.sh index 3581fdf..0a470c1 100644 --- a/tools/po-compile.sh +++ b/tools/po-compile.sh @@ -3,15 +3,26 @@ set -e cd "$(readlink -f "$(dirname "$0")/..")" - -find "$PWD/po" -type f -name '*.po' | \ -while read po_file; do - language="$(basename "$po_file")" +update_mo(){ + echo $1 + language="$(basename "$1")" language="${language%.po}" target="$PWD/share/locale/$language/LC_MESSAGES/isodumper.mo" + echo $target /bin/mkdir --parents "$(dirname "$target")" /usr/bin/msgfmt \ --check \ --output-file="$target" \ - "$po_file" -done + "$1" +} + +if test "$1"; then + for l in $(find "$PWD/po" -type f -name "$1.po"); do + echo $l + update_mo "$l" + done +else + for l in $(find "$PWD/po" -type f -name '*.po'); do + update_mo "$l" + done +fi \ No newline at end of file -- cgit v1.2.1