Re: How many words does GNOME 1.2 has?

Karl Eichwalder wrote:
> Jordi Mas <jmas softcatala org> writes:
> > Does anyone know how many words does GNOME 1.2 has? I mean, the word
> > couting for the original strings of all the POs.
> Eval the POT files with a few shell commands; e.g.:
>     grep -v ^# gnome-libs.pot | sed 's/^\(msgid\|msgstr\)//' | wc -w

Or you could get the message tarball and run the following for loop:

for file in `ls *.po`; do echo -n $file; grep -v '#' $file | awk -F'"'
'{print $2}' | wc -w; done

or in a more readable manner:

for file in `ls *.po`
echo -n $file 
grep -v '#' $file | awk -F'"' '{print $2}' | wc -w

This prints the filename and then searches for none comment lines. It
splits these lines using awk into three parts. It then prints the part
in between the quotes. 

This one liner assumes that the .po files only have the msgid ready for
translation and that there is only quotes after the msgstr. i.e. of the
msgid "some stuff"
"some more stuff"
msgstr ""
msgid "some stuff"
msgstr ""

The advantage of doing it this way is that the msgid and msgstr keywords
aren't counted and multi line strings are counted.

This will spit out something like:
achtung.po     414
balsa.po    1607
bonobo.po     492
bug-buddy.po     612
control-center-HEAD.po    1435
control-center.po    1346

I use this myself to get word counts. (In case you are interested from
the tarball
there are about 111000 words in gnome .po messages alone).

hope this helps,

Michael Twomey
Sun Microsystems
Dublin, 8199164, x19164
"Fly my little Makefiles! Fly!"

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]