Convert original OOo .po files to Rosetta .po files

Tim Morley t_morley at
Wed Jun 14 15:31:52 BST 2006

OK, scripting gurus, what's wrong with my script (below)? Or more to  
the point, why does it take four and a half days (really!) to process?

I've just written a message to the list about converting ~230 .po  
files from into ~10 needed for Rosetta, and the script  
below is supposed to do the opposite automagically (~10 files -->  
~230 files). Well, it *does* exactly that; it just takes an age.

It's explained in a bit more detail at the bottom of this page:
but if someone could tell me what's making it take so long, I'd be  

Briefly, the script goes like this:
1   for f in `find . -name "*.pot"`;
2      do tempfile=`dirname $f`/temp.po;
3      msgmerge everythingFromRosetta.po $f > $tempfile;
4      awk
5        '$1 !~ /^#~/ {print $0} $1 ~ /^#~/ {exit}'
6          $tempfile > `dirname $f`/`basename $f pot`po;
7      rm $tempfile;
8   done

which says roughly:
1   find all the ~230 .pot files waiting to be filled with translated  
3   merge all the translations from Rosetta into each of these ~230  
files in turn
5   with each file, allow all lines that don't start with #~, but as  
soon as we reach the first #~, throw the rest of the file away
6   write the result in the same place as the .pot file and give it  
the same filename with a .po extension
7   remove temp file

So, can anybody tell me what the drag is?

Thanks in advance.

Ubuntu Esperanto Team

More information about the rosetta-users mailing list