mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
IGN:Use launchpad branch to merge updated translations
This commit is contained in:
parent
f607124d30
commit
c690bca24a
3
setup.py
3
setup.py
@ -72,7 +72,7 @@ if __name__ == '__main__':
|
|||||||
build_osx, upload_installers, upload_user_manual, \
|
build_osx, upload_installers, upload_user_manual, \
|
||||||
upload_to_pypi, stage3, stage2, stage1, upload, \
|
upload_to_pypi, stage3, stage2, stage1, upload, \
|
||||||
upload_rss, betas, build_linux32, build_linux64, \
|
upload_rss, betas, build_linux32, build_linux64, \
|
||||||
build_osx64
|
build_osx64, get_translations
|
||||||
resources.SCRIPTS = {}
|
resources.SCRIPTS = {}
|
||||||
for x in ('console', 'gui'):
|
for x in ('console', 'gui'):
|
||||||
for name in basenames[x]:
|
for name in basenames[x]:
|
||||||
@ -265,6 +265,7 @@ if __name__ == '__main__':
|
|||||||
'manual' : manual,
|
'manual' : manual,
|
||||||
'resources' : resources,
|
'resources' : resources,
|
||||||
'translations' : translations,
|
'translations' : translations,
|
||||||
|
'get_translations': get_translations,
|
||||||
'gui' : gui,
|
'gui' : gui,
|
||||||
'clean' : clean,
|
'clean' : clean,
|
||||||
'sdist' : sdist,
|
'sdist' : sdist,
|
||||||
|
26
upload.py
26
upload.py
@ -281,6 +281,32 @@ class translations(OptionlessCommand):
|
|||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
||||||
|
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])
|
||||||
|
|
||||||
|
def check_for_errors(self):
|
||||||
|
errors = os.path.join(self.PATH, '.errors')
|
||||||
|
if os.path.exists(errors):
|
||||||
|
shutil.rmtree(errors)
|
||||||
|
pofilter = ('pofilter', '-i', '.', '-o', errors,
|
||||||
|
'-t', 'accelerators', '-t', 'escapes', '-t', 'variables',
|
||||||
|
#'-t', 'xmltags',
|
||||||
|
'-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)
|
||||||
|
|
||||||
|
|
||||||
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