From a41078a88aa92e9a49465e7208c0795ddf075c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 19 May 2023 10:12:23 +0200 Subject: [PATCH] docs: Describe introducing new strings Issue #9189 --- docs/admin/continuous.rst | 2 +- docs/devel/integration.rst | 32 ++++++++++++++++++++++++++++++++ docs/faq.rst | 12 +----------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/docs/admin/continuous.rst b/docs/admin/continuous.rst index bc7e502fd510..e3460bc446e4 100644 --- a/docs/admin/continuous.rst +++ b/docs/admin/continuous.rst @@ -15,7 +15,7 @@ instead of working through huge amount of new text just prior to release. This is the process: 1. Developers make changes and push them to the VCS repository. -2. Optionally the translation files are updated (this depends on the file format, see :ref:`translations-update`). +2. Optionally the translation files are updated, see :ref:`translations-update`. 3. Weblate pulls changes from the VCS repository, see :ref:`update-vcs`. 4. Once Weblate detects changes in translations, translators are notified based on their subscription settings. 5. Translators submit translations using the Weblate web interface, or upload offline changes. diff --git a/docs/devel/integration.rst b/docs/devel/integration.rst index e9ec0b6b8641..5848eef88312 100644 --- a/docs/devel/integration.rst +++ b/docs/devel/integration.rst @@ -109,6 +109,38 @@ using :guilabel:`Update source strings` :ref:`upload-method` or using :ref:`addon-weblate.resx.update`, :ref:`addon-weblate.gettext.msgmerge` + +.. _translations-update: + +Introducing new strings ++++++++++++++++++++++++ + +You can add new strings in Weblate with :ref:`component-manage_units` turned +on, but it is usually better to introduce new strigs together with the code +changes that introduced them. + +Monolingual formats need addition of the new string to +:ref:`component-template`. This is typically done by the developers during +developing the code. You might want to introduce review of those strings using +:ref:`source-quality-gateway`. + +Bilingual formats typically extract strings from the source code using some +tooling. Follow your localization framework documentation for instructions how +to do that. Once the strings are extracted, there might be an additional step +needed to update existing translations, see :ref:`updating-target-files`. + +.. hint:: + + You might want to integrate this into your contrinuous integration pipelines + to make new strings automatically appear for translation. Such pipeline + should also cover :ref:`avoid-merge-conflicts`. + +.. seealso:: + + :ref:`updating-target-files`, + :doc:`/devel/gettext`, + :doc:`/devel/sphinx` + .. _manage-vcs: Managing version control repository diff --git a/docs/faq.rst b/docs/faq.rst index a2a649857864..ff4627775f65 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -383,7 +383,6 @@ For Gettext PO files, you have to pass the parameter ``--previous`` to For monolingual translations, Weblate can find the previous string by ID, so it shows the differences automatically. -.. _translations-update: Why does Weblate still show old translation strings when I've updated the template? ----------------------------------------------------------------------------------- @@ -400,18 +399,9 @@ will then pick up the changes automatically. translation files, as otherwise you will usually end up with some conflicts to merge. -For example with gettext PO files, you can update the translation files using -the :command:`msgmerge` tool: - -.. code-block:: sh - - msgmerge -U locale/cs/LC_MESSAGES/django.mo locale/django.pot - -In case you want to do the update automatically, you can install -add-on :ref:`addon-weblate.gettext.msgmerge`. - .. seealso:: + :ref:`translations-update`, :ref:`updating-target-files`, :doc:`/devel/gettext`, :doc:`/devel/sphinx`