From 0ce29d414c4c666851d4ae4ca9c2009652c7bdec Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 23 Feb 2016 14:56:05 +0530 Subject: [PATCH] Generate translations template for new content server --- setup/translations.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/setup/translations.py b/setup/translations.py index 0f4914ab6d..4ee0ef064a 100644 --- a/setup/translations.py +++ b/setup/translations.py @@ -84,6 +84,19 @@ class POT(Command): # {{{ return '\n'.join(ans) + 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') + with open(dest, 'wb') as f: + f.write(pottext) + self.upload_pot(dest, resource='content_server') + self.git(['add', dest]) + def get_user_manual_docs(self): self.info('Generating translation templates for user_manual') base = tempfile.mkdtemp() @@ -118,6 +131,7 @@ class POT(Command): # {{{ def run(self, opts): require_git_master() + self.get_content_server_strings() self.get_user_manual_docs() pot_header = textwrap.dedent('''\ # Translation template file..