Skip to content

Commit

Permalink
docs: Describe introducing new strings
Browse files Browse the repository at this point in the history
Issue #9189
  • Loading branch information
nijel committed May 19, 2023
1 parent e0cd401 commit a41078a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/admin/continuous.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
32 changes: 32 additions & 0 deletions docs/devel/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 1 addition & 11 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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?
-----------------------------------------------------------------------------------
Expand All @@ -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`
Expand Down

0 comments on commit a41078a

Please sign in to comment.