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):
|
def get_content_server_strings(self):
|
||||||
self.info('Generating translation template for content_server')
|
self.info('Generating translation template for content_server')
|
||||||
pottext = subprocess.check_output([
|
from calibre import walk
|
||||||
'rapydscript', 'gettext', '--package-name', __appname__, '--package-version', __version__,
|
from calibre.utils.rapydscript import create_pot
|
||||||
'--bug-address', 'https://bugs.launchpad.net/calibre', self.j(self.SRC, 'pyj')
|
files = (f for f in walk(self.j(self.SRC, 'pyj')) if f.endswith('.pyj'))
|
||||||
])
|
pottext = create_pot(files).encode('utf-8')
|
||||||
tbase = self.j(self.TRANSLATIONS, 'content-server')
|
dest = self.j(self.TRANSLATIONS, 'content-server', 'content-server.pot')
|
||||||
dest = self.j(tbase, 'content-server.pot')
|
|
||||||
with open(dest, 'wb') as f:
|
with open(dest, 'wb') as f:
|
||||||
f.write(pottext)
|
f.write(pottext)
|
||||||
self.upload_pot(dest, resource='content_server')
|
self.upload_pot(dest, resource='content_server')
|
||||||
|
@ -117,7 +117,7 @@ def create_pot(source_files):
|
|||||||
ctx.g.gettext_options = {
|
ctx.g.gettext_options = {
|
||||||
'package_name': __appname__,
|
'package_name': __appname__,
|
||||||
'package_version': __version__,
|
'package_version': __version__,
|
||||||
'bugs_address': 'kovid@kovidgoyal.net'
|
'bugs_address': 'https://bugs.launchpad.net/calibre'
|
||||||
}
|
}
|
||||||
ctx.eval('catalog = {}')
|
ctx.eval('catalog = {}')
|
||||||
for fname in source_files:
|
for fname in source_files:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user