39 |
|
|
40 |
cd /var/lib/pootle/tmp |
cd /var/lib/pootle/tmp |
41 |
|
|
42 |
|
# Sync database stores to filesystem |
43 |
|
django-admin sync_stores --settings=pootle.settings &> /dev/null |
44 |
|
|
45 |
for ver in sme7 sme8 |
for ver in sme7 sme8 |
46 |
do |
do |
47 |
# Update anaconda template |
# Update anaconda template |
55 |
diffmv backup-console.pot /var/lib/pootle/po/$ver/templates/backup-console.pot |
diffmv backup-console.pot /var/lib/pootle/po/$ver/templates/backup-console.pot |
56 |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-manager/$ver/ -type f -name 25Copyright) > foot.tmpl.pot |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-manager/$ver/ -type f -name 25Copyright) > foot.tmpl.pot |
57 |
diffmv foot.tmpl.pot /var/lib/pootle/po/$ver/templates/foot.tmpl.pot |
diffmv foot.tmpl.pot /var/lib/pootle/po/$ver/templates/foot.tmpl.pot |
58 |
potempl $(find /var/lib/pootle/cvs/smeserver/*/$ver/ -type f -regex '.*/e-?smith/console.*') > server-console.pot |
potempl $(find /var/lib/pootle/cvs/smeserver/*/$ver/ -type f -regex '.*/e-?smith/console.*' -not -regex '.*\+ldap/.*') > server-console.pot |
59 |
diffmv server-console.pot /var/lib/pootle/po/$ver/templates/server-console.pot |
diffmv server-console.pot /var/lib/pootle/po/$ver/templates/server-console.pot |
60 |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-quota/$ver/ -type f -name userOverQuota.tmpl) > userOverQuota.tmpl.pot |
potempl $(find /var/lib/pootle/cvs/smeserver/e-smith-quota/$ver/ -type f -name userOverQuota.tmpl) > userOverQuota.tmpl.pot |
61 |
diffmv userOverQuota.tmpl.pot /var/lib/pootle/po/$ver/templates/userOverQuota.tmpl.pot |
diffmv userOverQuota.tmpl.pot /var/lib/pootle/po/$ver/templates/userOverQuota.tmpl.pot |
96 |
do |
do |
97 |
# Create compendium to assist translations |
# Create compendium to assist translations |
98 |
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) \ |
99 |
<(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) \ |
100 |
> /var/lib/pootle/tmp/compendium-$lang.po |
> /var/lib/pootle/tmp/compendium-$lang.po |
101 |
|
|
102 |
# Use compendium to migrate each project to new template |
# Use compendium to migrate each project to new template |
103 |
for proj in $(ls -d /var/lib/pootle/po/{sme,contribs}[0-9]/$lang 2> /dev/null | sed 's@.*/\([^/]\+\)/[^/]\+$@\1@') |
for ver in $(ls -d /var/lib/pootle/po/{sme,contribs}[0-9]/$lang 2> /dev/null | sed 's@.*/\([^/]\+\)/[^/]\+$@\1@') |
104 |
do |
do |
105 |
mkdir -p /var/lib/pootle/tmp/$proj/$lang |
mkdir -p /var/lib/pootle/tmp/$ver/$lang |
106 |
pomigrate2 -F -C=/var/lib/pootle/tmp/compendium-$lang.po -q --locale=$lang \ |
pomigrate2 -F -C=/var/lib/pootle/tmp/compendium-$lang.po -q --locale=$lang \ |
107 |
/var/lib/pootle/po/$proj/$lang /var/lib/pootle/tmp/$proj/$lang /var/lib/pootle/po/$proj/templates > /dev/null |
/var/lib/pootle/po/$ver/$lang /var/lib/pootle/tmp/$ver/$lang /var/lib/pootle/po/$ver/templates > /dev/null |
108 |
|
|
109 |
# Ensure language is correct |
# Ensure language is correct |
110 |
sed -i "/msgid \"en-us\"/{N;s@msgstr \"[^\"]*\"@msgstr \"$lang\"@}" /var/lib/pootle/tmp/$proj/$lang/* 2> /dev/null |
sed -i "/msgid \"en-us\"/{N;s@msgstr \"[^\"]*\"@msgstr \"$lang\"@}" /var/lib/pootle/tmp/$ver/$lang/* 2> /dev/null |
111 |
|
|
112 |
# Generate translation memory for panels |
# Set package version in po files |
113 |
updatetm --progress none -c 4 -i /var/lib/pootle/tmp/$proj/$lang -t /var/lib/pootle/tmp/compendium-$lang.po -o /var/lib/pootle/tmp/$proj/$lang |
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 |
|
done |
|
|
done |
|
114 |
|
|
115 |
# Set package name/version in new po files |
# Generate translation memory for panels |
116 |
for ver in 7 8 |
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 |
|
do |
|
|
find /var/lib/pootle/tmp/sme$ver/ -name '*.po' -printf "sed -i 's@Id-Version:[^\\\\]*@Id-Version: SME Server $ver (%f)@' %p\n" | sh |
|
|
find /var/lib/pootle/tmp/contribs$ver/ -name '*.po' -printf "sed -i 's@Id-Version:[^\\\\]*@Id-Version: SME Contribs $ver (%f)@' %p\n" | sh |
|
|
done |
|
117 |
|
|
118 |
# Move files that have changed |
find /var/lib/pootle/tmp/$ver/$lang -type f | while read pkg |
119 |
for chk in $(find /var/lib/pootle/tmp/{sme,contribs}[0-9]/ -type f) |
do |
120 |
do |
# Move files that have changed |
121 |
diffmv $chk $(echo $chk | sed 's@/tmp/@/po/@') |
diffmv $pkg $(echo $pkg | sed 's@/tmp/@/po/@') |
122 |
|
done |
123 |
|
done |
124 |
done |
done |
125 |
|
|
126 |
# Copy po files so we can create error reports |
# Copy po files so we can create error reports |
128 |
|
|
129 |
#========================================================== |
#========================================================== |
130 |
|
|
131 |
|
# Sync filesystem to database stores |
132 |
|
django-admin update_stores --settings=pootle.settings &> /dev/null |
133 |
|
|
134 |
# Recalculate stats and restart server |
# Recalculate stats and restart server |
135 |
/usr/sbin/PootleServer --refreshstats &> /dev/null |
django-admin refresh_stats --settings=pootle.settings &> /dev/null |
136 |
|
|
137 |
#========================================================== |
#========================================================== |
138 |
|
|