diff options
author | Nicolas Lécureuil <nlecureuil@mandriva.com> | 2009-05-14 19:27:25 +0000 |
---|---|---|
committer | Nicolas Lécureuil <nlecureuil@mandriva.com> | 2009-05-14 19:27:25 +0000 |
commit | 3f7a8b63cb4105d4ac64b5564afdcb6f00620453 (patch) | |
tree | 352c96e0b3a798275a69da50508353253077c5f0 /po/Messages.sh | |
download | splash-3f7a8b63cb4105d4ac64b5564afdcb6f00620453.tar splash-3f7a8b63cb4105d4ac64b5564afdcb6f00620453.tar.gz splash-3f7a8b63cb4105d4ac64b5564afdcb6f00620453.tar.bz2 splash-3f7a8b63cb4105d4ac64b5564afdcb6f00620453.tar.xz splash-3f7a8b63cb4105d4ac64b5564afdcb6f00620453.zip |
Branch for 2009.1 and handle trunk
Diffstat (limited to 'po/Messages.sh')
-rwxr-xr-x | po/Messages.sh | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/po/Messages.sh b/po/Messages.sh new file mode 100755 index 0000000..cc1f3ad --- /dev/null +++ b/po/Messages.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +BASEDIR=".." +PROJECT="kde4-splash-mdv" +BUGADDR="https://qa.mandriva.com" +WDIR=`pwd` + +echo "Preparing rc files" + +cd ${BASEDIR} + +# we use simple sorting to make sure the lines do not jump around too much from system to system + +find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list + +xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp + +# additional string for KAboutData + +echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp +echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp + +cd ${WDIR} + +echo "Done preparing rc files" + +echo "Extracting messages" + +cd ${BASEDIR} + +# see above on sorting + +find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list + +echo "rc.cpp" >> ${WDIR}/infiles.list + +cd ${WDIR} + +xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 \ + -ki18ncp:1c,2,3 -ktr2i18n:1 -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale \ + -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \ + --msgid-bugs-address="${BUGADDR}" --files-from=infiles.list -D ${BASEDIR} \ + -D ${WDIR} -o ${PROJECT}.pot || \ + { echo "error while calling xgettext. aborting."; exit 1; } + +echo "Done extracting messages" + +echo "Merging translations" + +catalogs=`find . -name '*.po'` + +for cat in $catalogs; do +echo $cat +msgmerge -o $cat.new $cat ${PROJECT}.pot +mv $cat.new $cat +done + +echo "Done merging translations" + +echo "Cleaning up" +cd ${WDIR} + +rm rcfiles.list +rm infiles.list +rm rc.cpp + +echo "Done" |