diff options
Diffstat (limited to 'po/merge.sh')
-rw-r--r-- | po/merge.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/po/merge.sh b/po/merge.sh new file mode 100644 index 0000000..68dc352 --- /dev/null +++ b/po/merge.sh @@ -0,0 +1,27 @@ +#/bin/bash +DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd` +packageRoot="kodereviewer" +echo "[merge] Extracting messages" +packageName="org.deprecated.kodereviewer" +find "${packageRoot}" -name '*.py' -name '*.cpp' -o -name '*.h' -o -name '*.c' -o -name '*.qml' -o -name '*.js' | sort > "${DIR}/infiles.list" + + +echo "[merge] Merging messages" +catalogs=`find . -name '*.po' | sort` +for cat in $catalogs; do + echo "[merge] $cat" + catLocale=`basename ${cat%.*}` + msgmerge \ + --width=400 \ + --add-location=file \ + --no-fuzzy-matching \ + -o "$cat.new" \ + "$cat" "${DIR}/template.po" + sed -i 's/# SOME DESCRIPTIVE TITLE./'"# Translation of ${widgetName} in ${catLocale}"'/' "$cat.new" + sed -i 's/# Translation of '"${widgetName}"' in LANGUAGE/'"# Translation of ${widgetName} in ${catLocale}"'/' "$cat.new" + sed -i 's/# Copyright (C) YEAR THE PACKAGE'"'"'S COPYRIGHT HOLDER/'"# Copyright (C) $(date +%Y)"'/' "$cat.new" + + mv "$cat.new" "$cat" +done + +echo "[merge] Done merging messages" |