Commit Graph

212 Commits

Author SHA1 Message Date
Takeshi KOMIYA
b20e04968e
Merge pull request #10107 from Jean-Abou-Samra/intl-warnings
Implement #noqa for i18n
2022-03-27 23:00:57 +09:00
Adam Turner
6bb7b891a1 Remove copyright and licence fields 2022-02-20 03:06:23 +00:00
Adam Turner
b691ebcc3e Conform to PEP 257 summary line conventions 2022-02-20 02:57:02 +00:00
Adam Turner
5694e0ce60 Fix module docstring indentation 2022-02-20 00:35:13 +00:00
Adam Turner
4f5a3269a6 Fix module docstring first line 2022-02-20 00:11:08 +00:00
Adam Turner
6b8bccec59 Remove module titles in docstrings 2022-02-19 23:17:29 +00:00
Jean Abou Samra
94d78d8747 Close #3985: Implement #noqa for i18n
When cross-references in the original paragraph and the translated
paragraph do not match, a warning is emitted.  It is useful, because
it allows to catch mistakes, but it can also be an annoyance since
sometimes it is expected that the cross-references will not match.
For example, a reference that is repeated in the original text may
need to be factored out for good style in the target language.
Another example: if the translator needs to translate a universally
understood term in the source language into a term that not everyone
knows is the translation of this original term, adding a reference to
the glossary can be warranted.  This allows the translated message to
start with '#noqa' in order to disable the warning.
2022-02-15 19:51:06 +01:00
Daniel Eades
6697ed62ed address some unused loop control variables (B007) 2022-01-12 20:19:18 +00:00
Jean Abou Samra
0269bec1ed In translated docs, sort glossaries by translated terms
This is done by moving the sorting from the glossary directive to a
transform operating after the i18n transform.

Closes #9827
2022-01-12 16:47:40 +01:00
Takeshi KOMIYA
b84771dcd2 A happy new year! 2022-01-01 18:45:03 +09:00
Takeshi KOMIYA
203094b4c3 Close #9618: i18n: Add gettext_allow_fuzzy_translations 2021-11-10 01:32:02 +09:00
Takeshi KOMIYA
bde6c8d2ef Fix test: Tests has been broken with pygments-2.10+ 2021-08-19 23:26:42 +09:00
Joe Nelson
e6ae41ed52 Include "role" attribute in expected HTML fragment 2021-06-21 17:08:24 -05:00
igo95862
e67c9e5df1
doc: Upgrade docutils.sourceforge.io links to HTTPS
Also change any docutils.sourceforge.net link to io
top level domain.
2021-05-16 15:53:49 +03:00
Takeshi KOMIYA
ce5d66e618
Merge pull request #9053 from tk0miya/title_node_for_toctree_caption
Fix #8870: Use title node for the caption of toctree
2021-04-09 01:35:46 +09:00
Takeshi KOMIYA
5604f9c420 Fix #8870: Use title node for the caption of toctree
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
2021-04-09 01:02:29 +09:00
Takeshi KOMIYA
41a377fee5 Merge branch '3.x' 2021-04-04 00:06:45 +09:00
Takeshi KOMIYA
a6d9b24a3b test: Update testcase for docutils-0.17 (toctree caption)
Since v0.17, docutils starts to use <figcaption> for caption on HTML
output.  This modifies the expected value of our testcases to support
it.
2021-04-03 23:54:19 +09:00
Takeshi KOMIYA
84b9d49826 test: Update testcase for docutils-0.17 (<section>)
Since v0.17, docutils starts to use <section> for section on HTML
output.  This modifies the expected value of our testcases to support
it.
2021-04-03 23:54:19 +09:00
Takeshi KOMIYA
4b452338f9 Merge branch '3.x' 2021-01-01 13:57:19 +09:00
Takeshi KOMIYA
f996859420 A happy new year!
.. note::

   $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \;
   $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
2021-01-01 13:40:48 +09:00
Takeshi KOMIYA
3a4ae2092a Merge branch '3.x' 2020-11-21 01:01:36 +09:00
Takeshi KOMIYA
f86366a2df test: Merge testcases having the same name 2020-11-16 00:03:20 +09:00
Takeshi KOMIYA
279e547860 Merge branch '3.x' 2020-11-12 02:50:43 +09:00
François Freitag
0949735210
Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.

The isort project has more feature and is more active than the
flake8-import-order plugin.

Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
2020-11-11 13:19:05 +01:00
Takeshi KOMIYA
598b85da75 Merge branch '3.x' into master 2020-10-04 22:41:44 +09:00
Takeshi KOMIYA
37235c71e0 Fix #6640: i18n: Failed to override system message translation
Our document describes that users can override system messages via
their own message catalog named `sphinx.mo` under the locale_dirs.
But it has not been used since its beginning of i18n mechanism because
the priority of users' message catalog is lower than system's.

This makes the priority of users' message catalog higher than system's.
2020-10-04 13:31:37 +09:00
Takeshi KOMIYA
327c187284 Merge branch '3.x' 2020-07-24 23:49:45 +09:00
Takeshi KOMIYA
35e1623338 Fix #4888: i18n: Failed to add an explicit title to `:ref:` role
To allow to give (or not to give) an explicit title to the
pending_xref nodes on translation, this skips to override the
attribute on merge original and translated documents.
2020-07-19 15:00:38 +09:00
Takeshi KOMIYA
897be0ebae Close #7784: i18n: The alt text for image is translated by default
Make alt text for image translatable by default without settings of
gettext_additional_targets.
2020-07-19 12:58:28 +09:00
Takeshi KOMIYA
7aa5584a47 Fix #7301: capital characters are not allowed for node_id 2020-03-29 23:55:56 +09:00
Takeshi KOMIYA
7bbf79c313 Fix #7301: Allow . and _ for node_id
In development of 3.0, Sphinx starts to obey to the rule of
"Identifier Normalization" of docutils.  This extends it to allow
dots(".") and underscores("_") for node identifier.

It allows Sphinx to generate node identifier from source string as
possible as it is (bacause dots and underscores are usually used in
many programming langauges).

This change will keep not to break hyperlinks as possible.
2020-03-22 16:39:00 +09:00
Takeshi KOMIYA
729efd28b0 py domain: Generate node_id for objects in the right way 2020-03-07 02:00:50 +09:00
Takeshi KOMIYA
4dd8b1022f test: Use read_text() and read_bytes() 2020-02-01 11:58:51 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
5a05cabd6a Fix #6867: text: extra spaces are inserted to hyphenated words on folding lines 2019-11-30 22:44:13 +09:00
Takeshi KOMIYA
5aee836dc1 Close #4683: i18n: make explicit titles in toctree translatable 2019-11-01 22:01:06 +09:00
Takeshi KOMIYA
95723aa6f6 Fix flake8 violations 2019-07-01 00:28:30 +09:00
Takeshi KOMIYA
9b2c1c679a Fix #6444: test: replace example.com by existing page 2019-06-05 23:42:24 +09:00
Takeshi KOMIYA
86f0336693 Merge branch '2.0' 2019-03-21 02:21:59 +09:00
Takeshi KOMIYA
021749429d
Merge branch '2.0' into 6178_hidden_tocs 2019-03-19 01:23:17 +09:00
Jon Dufresne
22afc77c48 Python-3-only clean ups discovered by pyupgrade
https://github.com/asottile/pyupgrade

> A tool to automatically upgrade syntax for newer versions of the
> language.

- Drop u str prefix
- Drop base object inheritance
- Drop args to super()
- Use set literals
- Use dict comprehension
- Use set comprehension
2019-03-19 01:09:48 +09:00
Jon Dufresne
f210475489 Python-3-only clean ups discovered by pyupgrade
https://github.com/asottile/pyupgrade

> A tool to automatically upgrade syntax for newer versions of the
> language.

- Drop u str prefix
- Drop base object inheritance
- Drop args to super()
- Use set literals
- Use dict comprehension
- Use set comprehension
2019-03-17 12:58:03 -07:00
Takeshi KOMIYA
6698bd6b3f Fix #6178: i18n: Captions missing in translations for hidden TOCs 2019-03-17 17:19:33 +09:00
Takeshi KOMIYA
fb8838ee53 refactor: Use CatalogRepository instead of find_catalog_source_file() 2019-02-27 22:47:08 +09:00
Takeshi KOMIYA
90bf81bd37 test: Use get_doctree() to load doctree files 2019-02-17 20:27:48 +09:00
Takeshi KOMIYA
36d628929e Merge branch '1.8' 2019-01-26 13:40:19 +09:00
Takeshi KOMIYA
1182e7f6d2 refactor: compile .mo file only if needed on testing 2019-01-20 11:51:23 +09:00
Takeshi KOMIYA
c4c878303f encoding keyword for path.text() and path.write_text() is no longer needed 2019-01-03 10:58:07 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00