Changeset 2566:9bf417837888 for build-tools/po_update.sh
- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
build-tools/po_update.sh
r2283 r2566 68 68 { 69 69 tee - 70 70 71 71 $XGETTEXT \ 72 72 - \ … … 84 84 po_dir=`dirname $1` 85 85 po_tmp=$po_dir/tmp.po~ 86 86 87 87 if [ ! -d $po_dir ]; then 88 88 mkdir $po_dir 89 89 fi 90 90 91 91 if [ ! -f $po_file ]; then 92 92 cp $pot_file $po_file 93 93 perl -pi -e "s|; charset=CHARSET|; charset=UTF-8|sgi;" $po_file $po_file 94 94 fi 95 95 96 96 $MSGMERGE --no-location --no-wrap -o $po_tmp $po_file $pot_file 97 97 mv $po_tmp $po_file … … 108 108 -o locales/_pot/main.pot \ 109 109 -x locales/_pot/date.pot 110 110 111 111 echo "DONE" 112 112 113 113 # plugins.pot 114 114 echo "Building plugins PO template..." … … 123 123 -x locales/_pot/date.pot \ 124 124 -x locales/_pot/main.pot 125 125 126 126 echo "DONE" 127 127 128 128 # 129 129 # Update locales/<lang> if needed … … 132 132 exit 0; 133 133 fi 134 134 135 135 # Init locale if not present 136 136 if [ ! -d locales/$PO_LANG ]; then 137 137 mkdir -p locales/$PO_LANG/help 138 138 139 139 # Base help files 140 140 for i in locales/en/help/*.html; do … … 147 147 done 148 148 fi 149 149 150 150 # update main.po 151 151 echo "Updating <$PO_LANG> po files..." … … 158 158 # Plugin language update 159 159 # 160 160 161 161 if [ ! -d $PO_MODULE ]; then 162 162 echo "Module $PO_MODULE does not exist" … … 164 164 fi 165 165 echo "Module $PO_MODULE language update" 166 167 166 167 168 168 # 169 169 # Building po template file … … 173 173 fi 174 174 echo "Building main PO template..." 175 echo '<?php' >$PO_MODULE/__html_tpl_dummy.php 175 echo '<?php' >$PO_MODULE/__html_tpl_dummy.php 176 176 find $PO_MODULE -name '*.html' -exec grep -o '{{tpl:lang [^}]*}}' {} \; | sed 's/{{tpl:lang \(.*\)}}$/__\("\1")/' | sort -u \ 177 177 >> $PO_MODULE/__html_tpl_dummy.php 178 sed -i "" 's/\$/\\\$/g' $PO_MODULE/__html_tpl_dummy.php 179 178 sed -i "" 's/\$/\\\$/g' $PO_MODULE/__html_tpl_dummy.php 179 180 180 find $PO_MODULE -name '*.php' -print | \ 181 181 extract_strings \ … … 183 183 -o $PO_MODULE/locales/_pot/main.pot \ 184 184 -x locales/_pot/date.pot -x locales/_pot/main.pot -x locales/_pot/public.pot -x locales/_pot/plugins.pot 185 185 186 186 rm -f $PO_MODULE/__html_tpl_dummy.php 187 187 188 188 echo "DONE" 189 189 190 190 # 191 191 # Update locale/<lang>
Note: See TracChangeset
for help on using the changeset viewer.