[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Translation status script
From: |
Thomas Keller |
Subject: |
[Monotone-devel] Translation status script |
Date: |
Tue, 23 Jan 2007 11:09:47 +0100 |
User-agent: |
Thunderbird 1.5.0.9 (X11/20060911) |
Hi all!
I just wrote a little python script which shows me the translation
status for monotone. For this purpose it queries the files directly via
mtn cat and feeds them into msgfmt -cv.
I initially thought this would be a nice addition for tracmtn (or some
trac module which is included), but since my Python knowledge is very
limited I soon noticed that this is not a quickie and decided to
implement this as a simple shell script. Still, having this in place
somewhere on the web might be faster for translators to check the status
- maybe one could even color it nicely and add a file download
possibility as well.
Another todo would be to read the manifest of the given revision first
and parse out any "*.po" files - then one could get even rid of
monotone's specific file locations and pre-determined translations... =)
Thomas.
--
ICQ: 85945241 | SIP: 1-747-027-0392 | http://www.thomaskeller.biz
> Guitone, a frontend for monotone: http://guitone.thomaskeller.biz
> Music lyrics and more: http://musicmademe.com
#!/usr/bin/python
import os
import sys
import traceback
db = "~/private/monotone.mtn"
rev = "h:net.venge.monotone"
trans = ['de','it','sv','es','fr','ja','pt_BR']
try:
for t in trans:
out = os.popen("mtn -d \"" + db + "\" cat -r " + rev + " po/" + t +
".po 2>/dev/null | msgfmt -cv -o /dev/null 2>&1 -").read().strip()
print t,":",out
except:
print "An error occured", sys.exc_info()
traceback.print_tb(sys.exc_info()[2])
sys.exit(1)
- [Monotone-devel] Translation status script,
Thomas Keller <=