From 775319ae15ef98b84c90f6ee6abf9cf39bc3bf4c Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 27 Apr 2020 18:22:56 +0200 Subject: [PATCH] Update python project setup instructions We don't need babel.cfg and instructions in setup.cfg anymore, see http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014233.html Update docs for this. Change-Id: Ibf9fdcddddf616fc9386b44ef33917421804238c --- doc/source/project_setup.rst | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/doc/source/project_setup.rst b/doc/source/project_setup.rst index 49a861d..4a2343a 100644 --- a/doc/source/project_setup.rst +++ b/doc/source/project_setup.rst @@ -31,30 +31,22 @@ Django project, a Python project or a ReactJS project. Python Projects --------------- -Update your ``setup.cfg`` file to include support for translation. It -should contain the ``compile_catalog``, ``update_catalog``, and -``extract_messages`` sections as well as a ``packages`` entry in the -``files`` section: +For translation of strings in Python files, only a few changes are +needed inside a project. + +.. note:: + Previously ``setup.cfg`` needed sections ``compile_catalog``, + ``update_catalog``, and ``extract_messages`` and a ``babel.cfg`` + file. These are not needed anymore and can be removed. + +Update your ``setup.cfg`` file. It should contain a ``packages`` entry +in the ``files`` section: .. code-block:: ini [files] packages = ${MODULENAME} - [compile_catalog] - directory = ${MODULENAME}/locale - domain = ${MODULENAME} - - [update_catalog] - domain = ${MODULENAME} - output_dir = ${MODULENAME}/locale - input_file = ${MODULENAME}/locale/${MODULENAME}.pot - - [extract_messages] - keywords = _ gettext ngettext l_ lazy_gettext - mapping_file = babel.cfg - output_file = ${MODULENAME}/locale/${MODULENAME}.pot - Replace ``${MODULENAME}`` with the name of your main module like ``nova`` or ``novaclient``. Your i18n setup file, normally named @@ -64,13 +56,6 @@ Replace ``${MODULENAME}`` with the name of your main module like _translators = oslo_i18n.TranslatorFactory(domain='${MODULENAME}') -Create file ``babel.cfg`` with the following content: - -.. code-block:: ini - - [python: **.py] - - Django Projects ---------------