93 |
do |
do |
94 |
# Create compendium to assist translations |
# Create compendium to assist translations |
95 |
msgcat --use-first <(msgcat $(find /var/lib/pootle/tmp/errors/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \ |
msgcat --use-first <(msgcat $(find /var/lib/pootle/tmp/errors/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \ |
96 |
<(msgcat $(find /var/lib/pootle/po/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \ |
<(msgcat --to-code UTF-8 $(find /var/lib/pootle/po/*/$lang/ -name '*.po') | msgattrib --translated --no-fuzzy) \ |
97 |
> /var/lib/pootle/tmp/compendium-$lang.po |
> /var/lib/pootle/tmp/compendium-$lang.po |
98 |
|
|
99 |
# Use compendium to migrate each project to new template |
# Use compendium to migrate each project to new template |
106 |
# Ensure language is correct |
# Ensure language is correct |
107 |
sed -i "/msgid \"en-us\"/{N;s@msgstr \"[^\"]*\"@msgstr \"$lang\"@}" /var/lib/pootle/tmp/$ver/$lang/* 2> /dev/null |
sed -i "/msgid \"en-us\"/{N;s@msgstr \"[^\"]*\"@msgstr \"$lang\"@}" /var/lib/pootle/tmp/$ver/$lang/* 2> /dev/null |
108 |
|
|
109 |
|
# Set package version in po files |
110 |
|
sed -i "s@\(Id-Version:\)[^\\]*@\1 SME $(echo $ver | sed 's@sme@Server @;s@contribs@Contribs @')@" /var/lib/pootle/tmp/$ver/$lang/*.po 2> /dev/null |
111 |
|
|
112 |
# Generate translation memory for panels |
# Generate translation memory for panels |
113 |
updatetm --progress none -c 4 -i /var/lib/pootle/tmp/$ver/$lang -t /var/lib/pootle/tmp/compendium-$lang.po -o /var/lib/pootle/tmp/$ver/$lang |
updatetm --progress none -c 4 -i /var/lib/pootle/tmp/$ver/$lang -t /var/lib/pootle/tmp/compendium-$lang.po -o /var/lib/pootle/tmp/$ver/$lang |
114 |
|
|
115 |
find /var/lib/pootle/tmp/$ver/$lang -type f | while read pkg |
find /var/lib/pootle/tmp/$ver/$lang -type f | while read pkg |
116 |
do |
do |
|
# Set package name/version in new po files |
|
|
[ "${pkg%%.po}" != "$pkg" ] && sed -i "/Id-Version:/{s@\(Version:\)[^\\]*@\1 SME $ver ($(basename $pkg))@;s@sme@Server @;s@contribs@Contribs @;}" $pkg |
|
|
|
|
117 |
# Move files that have changed |
# Move files that have changed |
118 |
diffmv $pkg $(echo $pkg | sed 's@/tmp/@/po/@') |
diffmv $pkg $(echo $pkg | sed 's@/tmp/@/po/@') |
119 |
done |
done |