Re: [PATCH v3 1/2] docs: doc-guide: add a guide for translators

From: Weijie Yuan

Date: Sat Nov 28 2026 - 09:35:08 EST


On Thu, Nov 19, 2026 at 01:10:08AM -0300, Daniel Pereira wrote:

[...]

> +Labels
> +------
> +
> +Sphinx labels (``.. _label:``) are global to the whole documentation
> +build. A label copied unchanged from the original therefore defines the
> +same name twice, which breaks the build or, at best, makes references
> +resolve to the wrong document.
> +
> +- Labels placed at the very top of a file are usually not needed at all
> + in the translation; simply drop them.
> +
> +- Labels that are needed, for example because other parts of the
> + translated document refer to them, must be made unique by adding a
> + language prefix. Each translation already uses one; look at existing
> + files to find it (``it_``, ``sp_``, ``cn_``, ``tw_``, ``pt_``, ...)::
> +
> + .. _it_process_howto:
> +
> +- References to labels of the English documentation are fine and
> + expected. When the target document is not translated yet, linking to
> + the English version is the right thing to do.

So sorry for bringing up this matter just now, here's what's recently
re-discussed in zh_CN:

Some contributors are adding unused (not referred) labels when sending
translations. Basically, in most(?) cases, they see this label in the
original English text, so they add it accordingly (and with "sp_").

So far, sorry that I haven't systematically investigated the situation
where these labels are cited. But I have come across some examples where
the labels in the original English text were not used at all. So the
labels in the newly added translation will definitely not be used. Or
there is another situation where the labels used in the original English
text come from articles that do not yet exist in this translation, or
vice versa.

For consistency, on the Simplified Chinese side, we have roughly decided
to follow the first principle, that is, do not add labels that have not
been used; if it needs to be used in the future, then add it in the
subsequent patches. However, it should be pointed out that this might
require more work from contributors and reviewers, because sphinx does
not warn labels that are not in use; therefore I mainly grep them every
time.

The following point may be beyond the scope of discussion in this patch
set: Currently, it is not seen in the existing documentation (sorry if I
missed any docs): Do not add unused labels. Do we need to notify it in
the existing documents not to do this? This might be helpful in
preventing the introduction of unused labels in new translations.

This is only the discussion result reached between me and Dongliang Mu.
It may not be applicable to all languages. Suggestions from everyone are
welcome as well.

Related thread:

https://lore.kernel.org/linux-doc/9d2b25e4-c5a0-4ef0-8698-1a622d05223e@xxxxxxxxxxx/

Thanks.