Use builtin RS compiler for generating POT files

This commit is contained in:
Kovid Goyal 2016-02-23 15:14:34 +05:30
parent 52e0e87e71
commit 6fdcc3c85f
2 changed files with 6 additions and 7 deletions

View File

@ -86,12 +86,11 @@ class POT(Command): # {{{
def get_content_server_strings(self):
self.info('Generating translation template for content_server')
pottext = subprocess.check_output([
'rapydscript', 'gettext', '--package-name', __appname__, '--package-version', __version__,
'--bug-address', 'https://bugs.launchpad.net/calibre', self.j(self.SRC, 'pyj')
])
tbase = self.j(self.TRANSLATIONS, 'content-server')
dest = self.j(tbase, 'content-server.pot')
from calibre import walk
from calibre.utils.rapydscript import create_pot
files = (f for f in walk(self.j(self.SRC, 'pyj')) if f.endswith('.pyj'))
pottext = create_pot(files).encode('utf-8')
dest = self.j(self.TRANSLATIONS, 'content-server', 'content-server.pot')
with open(dest, 'wb') as f:
f.write(pottext)
self.upload_pot(dest, resource='content_server')

View File

@ -117,7 +117,7 @@ def create_pot(source_files):
ctx.g.gettext_options = {
'package_name': __appname__,
'package_version': __version__,
'bugs_address': 'kovid@kovidgoyal.net'
'bugs_address': 'https://bugs.launchpad.net/calibre'
}
ctx.eval('catalog = {}')
for fname in source_files: