#/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"