Skip to content

Commit

Permalink
Close sphinx-doc#6781: gettext Add confvals to customize headers of P…
Browse files Browse the repository at this point in the history
…OT file

* gettext_last_translator
* gettext_language_team
  • Loading branch information
tk0miya committed Dec 14, 2019
1 parent be789b4 commit 301e73b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Features added
* #6816: linkcheck: Add :confval:`linkcheck_auth` option to provide
authentication information when doing ``linkcheck`` builds
* #6872: linkcheck: Handles HTTP 308 Permanent Redirect
* #6781: gettext: Add :confval:`gettext_last_translator' and
:confval:`gettext_language_team` to customize headers of POT file

Bugs fixed
----------
Expand Down
4 changes: 4 additions & 0 deletions sphinx/builders/gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ def finish(self) -> None:
'version': self.config.version,
'copyright': self.config.copyright,
'project': self.config.project,
'last_translator': self.config.gettext_last_translator,
'language_team': self.config.gettext_language_team,
'ctime': datetime.fromtimestamp(timestamp, ltz).strftime('%Y-%m-%d %H:%M%z'),
'display_location': self.config.gettext_location,
'display_uuid': self.config.gettext_uuid,
Expand Down Expand Up @@ -311,6 +313,8 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.add_config_value('gettext_uuid', False, 'gettext')
app.add_config_value('gettext_auto_build', True, 'env')
app.add_config_value('gettext_additional_targets', [], 'env')
app.add_config_value('gettext_last_translator', 'FULL NAME <EMAIL@ADDRESS>', 'gettext')
app.add_config_value('gettext_language_team', 'LANGUAGE <LL@li.org>', 'gettext')

return {
'version': 'builtin',
Expand Down
2 changes: 1 addition & 1 deletion sphinx/templates/gettext/message.pot_t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: {{ ctime|e }}\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: {{ last_translator|e }}\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down

0 comments on commit 301e73b

Please sign in to comment.