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

Re: msgfmt --statistics annoyance



On Sun, Jun 18, 2006 at 11:18:21AM +0200, Frans Pop wrote:
> Hi all,
> 
> When I run 'msgfmt --statistics <po-file>', msgfmt always creates a file 
> messages.mo.
> 
> If I only ask for statistics, why is this file created?

Because you didn't just ask for it, msgfmt is the tool used to compile a
message catalog (.po) to a binary (.mo). The '--statistics' makes it provide
additional information *after* the compilation.

> Can this be avoided?

No. Most stats generators will typically remove this file afterwads, like
when you do this:

for i in *.po; do 
	if  msgfmt --check "$i" 2>/dev/null 1>&2; then 
		echo "Statistics for $i"
		msgfmt --statistics "$i"
	else
		echo "ERR: Cannot generate stats for $i, invalid"
	fi
	# Either call to msgfmt will generate the mo file:
	rm -f messages.mo
done

Or when you use something more "pretty" like:
http://sciforge.org/viewcvs/ooo-bg/localization/interface/version_20/PO2STAT?rev=1.2
(Funny, Kumulate [1] doesn't seem to remove this file, however)


> What is the function of a messages.mo file anyway?

Thats the binary file that gets distributed under
/usr/share/locale/XX/LC_MESSAGES (with XX being the language code)

Regards

Javier


[1] http://www.dotmon.com/kumulate/

Attachment: signature.asc
Description: Digital signature


Reply to: