From fe8aea1c3b5348347633da18a02b0bffd3b266a1 Mon Sep 17 00:00:00 2001 From: Perberos Date: Thu, 1 Dec 2011 21:42:39 -0300 Subject: moving from https://github.com/perberos/mate-desktop-environment --- po-locations/regen.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 po-locations/regen.sh (limited to 'po-locations/regen.sh') diff --git a/po-locations/regen.sh b/po-locations/regen.sh new file mode 100755 index 0000000..f47e480 --- /dev/null +++ b/po-locations/regen.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +# Find a file called Locations.xml.in.h which is newer than both +# ../data/Locations.xml.in and extract.xsl, and if it's not found, +# build it. In other words, regenerate Locations.xml.in.h if it's +# missing or out of date. +find . -name Locations.xml.in.h \ + -newer ../data/Locations.xml.in \ + -newer extract.xsl \ + -print | grep -q . || { + echo "Rebuilding Locations.xml.in.h" + xsltproc extract.xsl ../data/Locations.xml.in > Locations.xml.in.h +} + +# Likewise locations.pot +find . -name locations.pot \ + -newer Locations.xml.in.h \ + -print | grep -q . || { + echo "Rebuilding locations.pot" + xgettext --add-comments --output=locations.pot --from-code=utf-8 \ + --keyword=N_ --keyword=NC_:1c,2 --no-location Locations.xml.in.h +} + +# Now rebuild po files given on command line, if any +status=0 +if [ -n "$*" ]; then + for po in "$@"; do + if [ -f $po ]; then + echo "Rebuilding $po" + msgmerge -U $po locations.pot + elif [ -f $po.po ]; then + echo "Rebuilding $po.po" + msgmerge -U $po.po locations.pot + else + echo "No such file: $po" 1>&2 + status=1 + fi + done +fi + +exit $status -- cgit v1.2.1