IGN:Updated translation template

This commit is contained in:
Kovid Goyal 2009-09-05 11:08:16 -06:00
parent c690bca24a
commit 101bb0b8e4
3 changed files with 42 additions and 26 deletions

View File

@ -208,7 +208,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
self.pos = DoubleSpinBox()
self.pos.setDecimals(1)
self.pos.setToolTip(_('Position in book'))
self.pos.setSuffix(_('/Unknown')+' ')
self.pos.setSuffix('/'+_('Unknown')+' ')
self.pos.setMinimum(1.)
self.tool_bar2.insertWidget(self.action_find_next, self.pos)
self.reference = HelpfulLineEdit()

View File

@ -5,8 +5,8 @@
msgid ""
msgstr ""
"Project-Id-Version: calibre 0.6.11\n"
"POT-Creation-Date: 2009-09-04 15:35+MDT\n"
"PO-Revision-Date: 2009-09-04 15:35+MDT\n"
"POT-Creation-Date: 2009-09-05 11:07+MDT\n"
"PO-Revision-Date: 2009-09-05 11:07+MDT\n"
"Last-Translator: Automatically generated\n"
"Language-Team: LANGUAGE\n"
"MIME-Version: 1.0\n"
@ -118,6 +118,7 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/library.py:404
#: /home/kovid/work/calibre/src/calibre/gui2/library.py:874
#: /home/kovid/work/calibre/src/calibre/gui2/library.py:1000
#: /home/kovid/work/calibre/src/calibre/gui2/viewer/main.py:211
#: /home/kovid/work/calibre/src/calibre/library/cli.py:268
#: /home/kovid/work/calibre/src/calibre/library/database.py:917
#: /home/kovid/work/calibre/src/calibre/library/database2.py:652
@ -5188,11 +5189,11 @@ msgstr ""
msgid "Fetch news from "
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/tools.py:201
#: /home/kovid/work/calibre/src/calibre/gui2/tools.py:202
msgid "Convert existing"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/tools.py:202
#: /home/kovid/work/calibre/src/calibre/gui2/tools.py:203
msgid "The following books have already been converted to %s format. Do you wish to reconvert them?"
msgstr ""
@ -5392,10 +5393,6 @@ msgstr ""
msgid "Position in book"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/viewer/main.py:211
msgid "/Unknown"
msgstr ""
#: /home/kovid/work/calibre/src/calibre/gui2/viewer/main.py:216
msgid "Go to a reference. To get reference numbers, use the reference mode."
msgstr ""

View File

@ -286,27 +286,46 @@ class get_translations(translations):
description = 'Get updated translations from Launchpad'
BRANCH = 'lp:~kovid/calibre/translations'
def run(self):
cwd = os.getcwd()
subprocess.check_call(['bzr', 'merge', self.BRANCH])
@classmethod
def modified_translations(cls):
raw = subprocess.Popen(['bzr', 'status'],
stdout=subprocess.PIPE).stdout.read().strip()
for line in raw.splitlines():
line = line.strip()
if line.startswith(cls.PATH) and line.endswith('.po'):
yield line
def check_for_errors(self):
errors = os.path.join(self.PATH, '.errors')
def run(self):
if len(list(self.modified_translations)) == 0:
subprocess.check_call(['bzr', 'merge', self.BRANCH])
if len(list(self.modified_translations)) == 0:
print 'No updated translations available'
else:
subprocess.check_call(['bzr', 'commit', '-m',
'IGN:Updated translations', self.PATH])
self.check_for_errors()
@classmethod
def check_for_errors(cls):
errors = os.path.join(tempfile.gettempdir(), 'calibre-translation-errors')
if os.path.exists(errors):
shutil.rmtree(errors)
pofilter = ('pofilter', '-i', '.', '-o', errors,
'-t', 'accelerators', '-t', 'escapes', '-t', 'variables',
#'-t', 'xmltags',
'-t', 'printf')
os.mkdir(errors)
pofilter = ('pofilter', '-i', cls.PATH, '-o', errors,
'-t', 'accelerators', '-t', 'escapes', '-t', 'variables',
#'-t', 'xmltags',
#'-t', 'brackets',
'-t', 'emails',
#'-t', 'doublequoting',
#'-t', 'filepaths',
'-t', 'numbers',
'-t', 'options',
'-t', 'urls',
'-t', 'printf')
subprocess.check_call(pofilter)
errs = os.listdir(errors)
if errs:
print 'WARNING: Translation errors detected'
print 'See http://translate.sourceforge.net/wiki/toolkit/using_pofilter'
print 'Error files:\n'
for e in errs:
print os.path.join(errors, e)
#for err in os.listdir(errors):
# subprocess.check_call(['gvim', os.path.join(errors, err)])
#subprocess.check_call(['pomerge', '-t', cls.PATH,
class gui(OptionlessCommand):
description='''Compile all GUI forms and images'''