mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use builtin RS compiler for generating POT files
This commit is contained in:
parent
52e0e87e71
commit
6fdcc3c85f
@ -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')
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user