3
# Automate the compilation of the various locale PO files by automatically
4
# generating them at night.
6
projname=boincclient612
7
projdir=/home/boincadm/pootle/po/$projname
12
# Update anything that needs updating
16
# Iterrate through the various PO files looking for those that need to be added to SVN.
18
for file in `find -name 'BOINC-Manager.po'` ; do
20
locale=`basename $dir`
21
template_name=${projdir}/${locale}/BOINC-Manager
23
# Add any missing PO files to SVN
24
svn add ${template_name}.po > /dev/null 2> /dev/null
25
svn propset svn:mime-type 'text/plain;charset=UTF-8' ${template_name}.po > /dev/null 2> /dev/null
29
# Iterrate through the various PO files looking for those that need to be added to SVN.
31
for file in `find -name 'BOINC-Client.po'` ; do
33
locale=`basename $dir`
34
template_name=${projdir}/${locale}/BOINC-Client
36
# Add any missing PO files to SVN
37
svn add ${template_name}.po > /dev/null 2> /dev/null
38
svn propset svn:mime-type 'text/plain;charset=UTF-8' ${template_name}.po > /dev/null 2> /dev/null
42
# Iterrate through the various PO files looking for those that need to be compiled.
44
for file in `find -name 'BOINC-Manager.po'` ; do
46
locale=`basename $dir`
47
template_name=${projdir}/${locale}/BOINC-Manager
49
if test ${template_name}.po -nt ${template_name}.mo
52
# Compile the PO file into an MO file.
53
pocompile ${template_name}.po ${template_name}.mo
55
# Add any new MO files to SVN
56
svn add ${template_name}.mo > /dev/null 2> /dev/null
58
# Touch each file to adjust timestamps
59
touch ${template_name}.po
60
touch ${template_name}.mo
66
# Iterrate through the various PO files looking for those that need to be compiled.
68
for file in `find -name 'BOINC-Client.po'` ; do
70
locale=`basename $dir`
71
template_name=${projdir}/${locale}/BOINC-Client
73
if test ${template_name}.po -nt ${template_name}.mo
76
# Compile the PO file into an MO file.
77
pocompile ${template_name}.po ${template_name}.mo > /dev/null 2> /dev/null
79
# Add any new MO files to SVN
80
svn add ${template_name}.mo > /dev/null 2> /dev/null
82
# Touch each file to adjust timestamps
83
touch ${template_name}.po
84
touch ${template_name}.mo
90
# Determine if we need to update the various languages using the templates.
91
# This will be done by the use of a tag file which should have a matching
92
# timestamp as the template files. If the timestamps do not match update all
94
for file in `find -name '*.pot'` ; do
95
template_rootname=`basename $file .pot`
96
template_name=${projdir}/templates/${template_rootname}
98
# Check to see if the file exists, if not create it
99
if test ! -e ${template_name}.flag
101
cp ${template_name}.pot ${template_name}.flag
104
# If the modification timestamps don't match then update all the languages
105
if test ${template_name}.pot -nt ${template_name}.flag
111
if test "${execute_update}" = "true"
114
for file in `find -name '*.po'` ; do
116
locale=`basename $dir`
117
po_name=`basename $file .po`
119
msgmerge --update ${locale}/${po_name}.po templates/${po_name}.pot
125
for file in `find -name '*.pot'` ; do
126
template_rootname=`basename $file .pot`
127
template_name=${projdir}/templates/${template_rootname}
129
# Touch each file to adjust timestamps
130
touch ${template_name}.pot
131
touch ${template_name}.flag
136
# Commit any changes to SVN
137
svn commit -m 'Update Translations'