mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Updated translation template
This commit is contained in:
parent
c690bca24a
commit
101bb0b8e4
@ -208,7 +208,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
|||||||
self.pos = DoubleSpinBox()
|
self.pos = DoubleSpinBox()
|
||||||
self.pos.setDecimals(1)
|
self.pos.setDecimals(1)
|
||||||
self.pos.setToolTip(_('Position in book'))
|
self.pos.setToolTip(_('Position in book'))
|
||||||
self.pos.setSuffix(_('/Unknown')+' ')
|
self.pos.setSuffix('/'+_('Unknown')+' ')
|
||||||
self.pos.setMinimum(1.)
|
self.pos.setMinimum(1.)
|
||||||
self.tool_bar2.insertWidget(self.action_find_next, self.pos)
|
self.tool_bar2.insertWidget(self.action_find_next, self.pos)
|
||||||
self.reference = HelpfulLineEdit()
|
self.reference = HelpfulLineEdit()
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: calibre 0.6.11\n"
|
"Project-Id-Version: calibre 0.6.11\n"
|
||||||
"POT-Creation-Date: 2009-09-04 15:35+MDT\n"
|
"POT-Creation-Date: 2009-09-05 11:07+MDT\n"
|
||||||
"PO-Revision-Date: 2009-09-04 15:35+MDT\n"
|
"PO-Revision-Date: 2009-09-05 11:07+MDT\n"
|
||||||
"Last-Translator: Automatically generated\n"
|
"Last-Translator: Automatically generated\n"
|
||||||
"Language-Team: LANGUAGE\n"
|
"Language-Team: LANGUAGE\n"
|
||||||
"MIME-Version: 1.0\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:404
|
||||||
#: /home/kovid/work/calibre/src/calibre/gui2/library.py:874
|
#: /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/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/cli.py:268
|
||||||
#: /home/kovid/work/calibre/src/calibre/library/database.py:917
|
#: /home/kovid/work/calibre/src/calibre/library/database.py:917
|
||||||
#: /home/kovid/work/calibre/src/calibre/library/database2.py:652
|
#: /home/kovid/work/calibre/src/calibre/library/database2.py:652
|
||||||
@ -5188,11 +5189,11 @@ msgstr ""
|
|||||||
msgid "Fetch news from "
|
msgid "Fetch news from "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: /home/kovid/work/calibre/src/calibre/gui2/tools.py:201
|
#: /home/kovid/work/calibre/src/calibre/gui2/tools.py:202
|
||||||
msgid "Convert existing"
|
msgid "Convert existing"
|
||||||
msgstr ""
|
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?"
|
msgid "The following books have already been converted to %s format. Do you wish to reconvert them?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -5392,10 +5393,6 @@ msgstr ""
|
|||||||
msgid "Position in book"
|
msgid "Position in book"
|
||||||
msgstr ""
|
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
|
#: /home/kovid/work/calibre/src/calibre/gui2/viewer/main.py:216
|
||||||
msgid "Go to a reference. To get reference numbers, use the reference mode."
|
msgid "Go to a reference. To get reference numbers, use the reference mode."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
53
upload.py
53
upload.py
@ -286,27 +286,46 @@ class get_translations(translations):
|
|||||||
description = 'Get updated translations from Launchpad'
|
description = 'Get updated translations from Launchpad'
|
||||||
BRANCH = 'lp:~kovid/calibre/translations'
|
BRANCH = 'lp:~kovid/calibre/translations'
|
||||||
|
|
||||||
def run(self):
|
@classmethod
|
||||||
cwd = os.getcwd()
|
def modified_translations(cls):
|
||||||
subprocess.check_call(['bzr', 'merge', self.BRANCH])
|
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):
|
def run(self):
|
||||||
errors = os.path.join(self.PATH, '.errors')
|
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):
|
if os.path.exists(errors):
|
||||||
shutil.rmtree(errors)
|
shutil.rmtree(errors)
|
||||||
pofilter = ('pofilter', '-i', '.', '-o', errors,
|
os.mkdir(errors)
|
||||||
'-t', 'accelerators', '-t', 'escapes', '-t', 'variables',
|
pofilter = ('pofilter', '-i', cls.PATH, '-o', errors,
|
||||||
#'-t', 'xmltags',
|
'-t', 'accelerators', '-t', 'escapes', '-t', 'variables',
|
||||||
'-t', 'printf')
|
#'-t', 'xmltags',
|
||||||
|
#'-t', 'brackets',
|
||||||
|
'-t', 'emails',
|
||||||
|
#'-t', 'doublequoting',
|
||||||
|
#'-t', 'filepaths',
|
||||||
|
'-t', 'numbers',
|
||||||
|
'-t', 'options',
|
||||||
|
'-t', 'urls',
|
||||||
|
'-t', 'printf')
|
||||||
subprocess.check_call(pofilter)
|
subprocess.check_call(pofilter)
|
||||||
errs = os.listdir(errors)
|
#for err in os.listdir(errors):
|
||||||
if errs:
|
# subprocess.check_call(['gvim', os.path.join(errors, err)])
|
||||||
print 'WARNING: Translation errors detected'
|
#subprocess.check_call(['pomerge', '-t', cls.PATH,
|
||||||
print 'See http://translate.sourceforge.net/wiki/toolkit/using_pofilter'
|
|
||||||
print 'Error files:\n'
|
|
||||||
for e in errs:
|
|
||||||
print os.path.join(errors, e)
|
|
||||||
|
|
||||||
|
|
||||||
class gui(OptionlessCommand):
|
class gui(OptionlessCommand):
|
||||||
description='''Compile all GUI forms and images'''
|
description='''Compile all GUI forms and images'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user