-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
7 changed files
with
153 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
First section | ||
============= | ||
|
||
Some text with a reference, :ref:`next-section`. | ||
|
||
Another reference: :ref:`next-section`. | ||
|
||
This should allow to test escaping ``#noqa``. | ||
|
||
.. _next-section: | ||
|
||
Next section | ||
============ | ||
|
||
Some text, again referring to the section: :ref:`next-section`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# SOME DESCRIPTIVE TITLE. | ||
# Copyright (C) | ||
# This file is distributed under the same license as the Sphinx intl <Tests> package. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: \n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2022-01-16 15:23+0100\n" | ||
"PO-Revision-Date: 2022-01-16 15:23+0100\n" | ||
"Last-Translator: Jean Abou Samra <jean@abou-samra.fr>\n" | ||
"Language-Team: \n" | ||
"Language: xx\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 3.0\n" | ||
|
||
#: ../tests/roots/test-intl/noqa.txt:2 | ||
msgid "First section" | ||
msgstr "" | ||
|
||
#: ../tests/roots/test-intl/noqa.txt:4 | ||
msgid "Some text with a reference, :ref:`next-section`." | ||
msgstr "TRANSLATED TEXT WITHOUT REFERENCE. #noqa" | ||
|
||
#: ../tests/roots/test-intl/noqa.txt:6 | ||
msgid "Another reference: :ref:`next-section`." | ||
msgstr "" | ||
"TEST WHITESPACE INSENSITIVITY.\n" | ||
"\n" | ||
"\n" | ||
" # \n" | ||
"\n" | ||
"noqa" | ||
|
||
#: ../tests/roots/test-intl/noqa.txt:8 | ||
msgid "This should allow to test escaping ``#noqa``." | ||
msgstr "``#noqa`` is escaped at the end of this string. \\#noqa" | ||
|
||
#: ../tests/roots/test-intl/noqa.txt:13 | ||
msgid "Next section" | ||
msgstr "" | ||
|
||
# This edge case should not fail. | ||
#: ../tests/roots/test-intl/noqa.txt:15 | ||
msgid "Some text, again referring to the section: :ref:`next-section`." | ||
msgstr "#noqa" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters