Commit 740c0f14 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix the check for updated msgids

When updating the msgids in an existing po translation, the diff from
the existing .po file to the the output was only
checking lines starting with "[+-]msg", in order to avoid pushing the
file every time there was a change to the .po header.

This needs to be changed because diffs in help files (and probably to
the second and later lines of multi-line translations) don't start
with 'msgid'.

Instead, attempt to find diffs on lines following the "X-Generator:
Launchpad" or "X-Launchpad-Export-Date:" lines (hopefully in the
parent 75985108
......@@ -148,7 +148,9 @@ for branch in ${branches} ; do
# New file
bzr add mahara/$pobase
podiffs=`bzr diff mahara/${pobase} | grep "[+-]msg"`
# There are always a few changes in the po header, but we don't care about them, so just
# check if anything's changed after the "X-Generator:" or "X-Launchpad-Export-Date:" lines
podiffs=`bzr diff mahara/${pobase} | awk '/^[+- ]"(X-Generator: Launchpad|X-Launchpad-Export-Date:)/ {p+=1;next}; p>1 {print}' | grep "^[+-]"`
if [ -z "$podiffs" ] ; then
# Nothing worth committing
bzr revert mahara/$pobase
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment