Skip to content

Commit

Permalink
Merge pull request #7458 from tk0miya/doc_indentation
Browse files Browse the repository at this point in the history
doc: Fix indentation
  • Loading branch information
tk0miya committed Apr 11, 2020
2 parents fd7c1d7 + eb46db0 commit b3e26a6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions doc/extdev/i18n.rst
Expand Up @@ -35,25 +35,25 @@ In practice, you have to:
:func:`sphinx.locale.get_translation` function, usually renamed ``_()``,
e.g.:

.. code-block:: python
:caption: src/__init__.py
.. code-block:: python
:caption: src/__init__.py
from sphinx.locale import get_translation
from sphinx.locale import get_translation
MESSAGE_CATALOG_NAME = 'myextension'
_ = get_translation(MESSAGE_CATALOG_NAME)
MESSAGE_CATALOG_NAME = 'myextension'
_ = get_translation(MESSAGE_CATALOG_NAME)
translated_text = _('Hello Sphinx!')
translated_text = _('Hello Sphinx!')
#. Set up your extension to be aware of its dedicated translations:

.. code-block:: python
:caption: src/__init__.py
.. code-block:: python
:caption: src/__init__.py
def setup(app):
package_dir = path.abspath(path.dirname(__file__))
locale_dir = os.path.join(package_dir, 'locales')
app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir)
def setup(app):
package_dir = path.abspath(path.dirname(__file__))
locale_dir = os.path.join(package_dir, 'locales')
app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir)
#. Generate message catalog template ``*.pot`` file, usually in ``locale/``
source directory, for example via `Babel`_:
Expand Down

0 comments on commit b3e26a6

Please sign in to comment.