
Op zaterdag 3 april 2010 14:31:14 schreef Carlos E. R.:
On 2010-04-03 11:20, Freek de Kruijf wrote:
Op donderdag 1 april 2010 22:34:05 schreef Carlos E. R.:
On Thursday, 2010-04-01 at 21:39 +0200, Freek de Kruijf wrote:
I do miss in the above script the check on .po files that do not have a counterpart .pot file. In which case the .po file should be deleted. Currently I have in each lcn and webyast 3 of these .po files.
Perhaps it existed in the original script. Anyway, I prefer deleting those manually, once I know they really have to be deleted. Notice that you have to delete the file in svn, or you will get it back on next "svn up".
Below is my script to handle .po files without corresponding .pot files, and merging .po files with newer .pot files and making .po files from a .pot file. It can be run from any directory above the trunk or branch directory. #!/bin/bash # openSUSE trunk and branch check for updates #set localization code loc="nl_NL.utf8" # save the current directory savedir=$(pwd) # setup the language lang="nl" # find the trunk and branch directories ldir=$(find ./ -name lcn) [ "ldir" != "" ] || { echo "directories with trunk and/or branch not found" ; cd $savedir; exit 1 ;} # check in all trunk and branch directories for dir in $ldir; do echo "branch/trunk is: ${dir%/lcn}" for lyw in lcn yast webyast; do cd $savedir [ -d ${dir%/lcn}/$lyw ] || { echo "$lyw directory not present" ; cd $savedir; continue ;} cd ${dir%/lcn}/$lyw echo "Now working in $(pwd)" # svn delete a .po file without a corresponding .pot file for file in $lang/po/*.po; do # there are 2 pot directories 00-pot and 50-pot, but not both is assumed here [ -d *0-pot ] || { echo "Directory *0-pot with .pot files not present"; continue ; } potfile=${file##$lang/po/}; potfile=${potfile%$lang.po}pot; #[ -f *0-pot/$potfile ] && echo "*0-pot/$potfile found" [ -f *0-pot/$potfile ] || { svn delete $file; } done [ -d *0-pot ] || continue for pot in *0-pot/*.pot; do # first check POT-Creation-Date, not equal means a merge potrevpot=$(grep POT-Creation-Date $pot) [ "$potrevpot" = "" ] && echo "$pot does not have a POT-Creation- Date:" pofile="$lang/po/${pot##*/}" pofile="${pofile%\.pot}.$lang.po" # when .po file does not exist, it needs to be created if [ ! -f $pofile ] ; then msginit --no-translator --locale=$loc --input=$pot -- output=$pofile continue fi potrevpo=$(grep POT-Creation-Date $pofile) [ "$potrevpo" = "" ] && echo "$pofile does not have a POT- Creation-Date:" [ "$potrevpot" != "" ] && [ "$potrevpo" != "" ] && [ "$potrevpot" = "$potrevpo" ] && continue echo "msgmerge --previous -U $pofile $pot" msgmerge --previous -U $pofile $pot done cd $savedir done done -- fr.gr. Freek de Kruijf -- To unsubscribe, e-mail: opensuse-translation+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-translation+help@opensuse.org