mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
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.
72 lines
943 B
Plaintext
72 lines
943 B
Plaintext
:tocdepth: 2
|
|
|
|
i18n with literal block
|
|
=========================
|
|
|
|
Correct literal block::
|
|
|
|
this is
|
|
literal block
|
|
|
|
Missing literal block::
|
|
|
|
That's all.
|
|
|
|
.. literalinclude:: raw.txt
|
|
:caption: included raw.txt
|
|
|
|
code blocks
|
|
==============
|
|
|
|
.. highlight:: ruby
|
|
|
|
::
|
|
|
|
def main
|
|
'result'
|
|
end
|
|
|
|
::
|
|
|
|
#include <stdlib.h>
|
|
int main(int argc, char** argv)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
.. code-block:: c
|
|
:caption: example of C language
|
|
|
|
#include <stdio.h>
|
|
int main(int argc, char** argv)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
* ::
|
|
|
|
literal-block
|
|
in list
|
|
|
|
.. highlight:: none
|
|
|
|
::
|
|
|
|
test_code_for_noqa()
|
|
continued()
|
|
|
|
|
|
doctest blocks
|
|
==============
|
|
|
|
.. highlight:: python
|
|
|
|
>>> import sys # sys importing
|
|
>>> def main(): # define main function
|
|
... sys.stdout.write('hello') # call write method of stdout object
|
|
>>>
|
|
>>> if __name__ == '__main__': # if run this py file as python script
|
|
... main() # call main
|
|
|