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:
Hi,
Recently updated .pot files appeared in trunk webyast. However updated (merged) .po files did not appear. So I tried to do the merging myself. Because doing it all by hand did not seem smart, so I designed a script to do that, also for yast and lcn.
I wrote another script, but only for webyast. I took an already existing script from lcn or yast as a base - those scripts live in the "50-tools/" directory, something "*merge". The problem is that they are not documented, we don't know their intended use.
#!/bin/bash
log=log.txt
:>$log
# Set to echo for debugging #echo=true echo=echo # set -x
fromdir=~/Projects/babel/SuSE/trunk/webyast potdir=00-pot memdir=50-memory
check_file () { [ -f $1 ] || { echo "*** file $1 does not exist" ; exit 1 ; } }
check_dir () { [ -d $1 ] || { echo "*** directory $1 does not exist" ; exit 1 ; } }
file_by_file () { fromdirpo="$fromdir/es/po" fromdirpot="$fromdir/$potdir" #$echo $fromdirpo #$echo $fromdirpot check_dir $fromdirpot for pot in $fromdirpot/*.pot; do check_file $pot textdomain=${pot##*/}; textdomain=${textdomain%\.pot} echo es/po/$textdomain.es.po | tee -a $log po=$fromdirpo/$textdomain.es.po if [ -f $po ]; then msgmerge --previous --update --backup=simple $po $pot else $echo " --> no existe $po, creandolo" | tee -a $log msginit --no-translator --locale=es_ES.utf8 --input=$pot --output=$po fi $echo echo done }
[ -z "$fromdir" ] && { echo "*** from DIR missing; exiting" exit 1 }
file_by_file
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.
And I see that I wrote another such a script long ago, on this desktop (the one I mention above I was using the portable and away from most of my scripts).
I assumed that by checking the POT-Creation-Date in the .pot and the corresponding .po file would give me an indication whether to use msgmerge or leave things alone. However I found .pot files without a POT-Creation-Date line.
I do a merge when I see the warning in "vertal". Another hint can be taken from the catalog tool kbabel uses, comparing the number of messages in the pot and po files.
I have no idea what "vertal" is.
I also found a file in the .../nl/po/ directory which did not end on .nl.po but only on .po
That's probably the fault of someone in your team; you can use "svn log somefile" and learn who created it. You can use "svn move" to rename it.
Or in this case svn delete wrongfilename
Will this be improved or do we have to work with these inconsistencies?
Some things need manual interaction, I think.
I am only confronted with the above discrepancies since opensuse-i18n moved to berlios. The argument that a user might be working on a file that get automatically updated is not very strong. It probably only need good communication of the time such an automatic update will be done. In the KDE project this is done automatically and one knows that the robot "scripty" is doing its work around a certain time, for me during the night. So I only need to commit my changes before I go to bed. -- fr.gr. Freek de Kruijf -- To unsubscribe, e-mail: opensuse-translation+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-translation+help@opensuse.org