Re: [PATCH 13/22] docs: zh_CN: avoid duplicate citation references

From: Mauro Carvalho Chehab
Date: Tue Jun 04 2019 - 06:47:27 EST


Em Tue, 4 Jun 2019 07:20:57 -0300
Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx> escreveu:

> Em Sun, 2 Jun 2019 23:01:21 +0800
> Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> escreveu:
>
> > On 2019/5/30 7:23 äå, Mauro Carvalho Chehab wrote:
> > > Documentation/process/management-style.rst:35: WARNING: duplicate label decisions, other instance in Documentation/translations/zh_CN/process/management-style.rst
> > > Documentation/process/programming-language.rst:37: WARNING: duplicate citation c-language, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > > Documentation/process/programming-language.rst:38: WARNING: duplicate citation gcc, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > > Documentation/process/programming-language.rst:39: WARNING: duplicate citation clang, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > > Documentation/process/programming-language.rst:40: WARNING: duplicate citation icc, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > > Documentation/process/programming-language.rst:41: WARNING: duplicate citation gcc-c-dialect-options, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > > Documentation/process/programming-language.rst:42: WARNING: duplicate citation gnu-extensions, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > > Documentation/process/programming-language.rst:43: WARNING: duplicate citation gcc-attribute-syntax, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > > Documentation/process/programming-language.rst:44: WARNING: duplicate citation n2049, other instance in Documentation/translations/zh_CN/process/programming-language.rst
> > >
> > > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx>
> > > ---
> > > .../zh_CN/process/management-style.rst | 4 +--
> > > .../zh_CN/process/programming-language.rst | 28 +++++++++----------
> > > 2 files changed, 16 insertions(+), 16 deletions(-)
> > >
> > > diff --git a/Documentation/translations/zh_CN/process/management-style.rst b/Documentation/translations/zh_CN/process/management-style.rst
> > > index a181fa56d19e..c6a5bb285797 100644
> > > --- a/Documentation/translations/zh_CN/process/management-style.rst
> > > +++ b/Documentation/translations/zh_CN/process/management-style.rst
> > > @@ -28,7 +28,7 @@ Linuxåæççéæ
> > >
> > > äçææïèéæï
> > >
> > > -.. _decisions:
> > > +.. _cn_decisions:
> > >
> > > 1ïåç
> > > -------
> > > @@ -108,7 +108,7 @@ Linuxåæççéæ
> > > äæïääååääåæççèçååïæåèääèçæääææïäèèçää
> > > æèçææïääèçèååçåæååäåãäåèæïçèäæçååæçïè
> > > äèääçèçäæåéçãåæïâçèâçååäâäåéâçèçïåææ
> > > -:ref:`decisions` æäçäåäåçäæã
> > > +:ref:`cn_decisions` æäçäåäåçäæã
> >
> > It's good to have.
> >
> > >
> > > èéåæåäçåçèåï
> > >
> > > diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
> > > index 51fd4ef48ea1..9de9a3108c4d 100644
> > > --- a/Documentation/translations/zh_CN/process/programming-language.rst
> > > +++ b/Documentation/translations/zh_CN/process/programming-language.rst
> > > @@ -8,21 +8,21 @@
> > > çåèèèè
> > > ============
> > >
> > > -åææçCèè [c-language]_ çåçãæåçåèïåæéåæç ``gcc`` [gcc]_
> > > -å ``-std=gnu89`` [gcc-c-dialect-options]_ äçèçïISO C90ç GNU æèï
> > > +åææçCèè [cn_c-language]_ çåçãæåçåèïåæéåæç ``gcc`` [cn_gcc]_
> >
> > this change isn't good. cn_gcc will show in docs, it looks wired and confusing for peoples. other changes have the same issue. Could you find other way to fix the warning? or I'd rather tolerant it.
>
> Well, Sphinx has a way to do that, like, for example:
>
> diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
> index 9de9a3108c4d..353fb8eaf4b5 100644
> --- a/Documentation/translations/zh_CN/process/programming-language.rst
> +++ b/Documentation/translations/zh_CN/process/programming-language.rst
> @@ -9,7 +9,7 @@
> ============
>
> åææçCèè [cn_c-language]_ çåçãæåçåèïåæéåæç ``gcc`` [cn_gcc]_
> -å ``-std=gnu89`` [cn_gcc-c-dialect-options]_ äçèçïISO C90ç GNU æèï
> +å ``-std=gnu89`` :ref:`gcc C dialect options <cn_gcc-c-dialect-options>` äçèçïISO C90ç GNU æèï
> åæääC99çæï
>
> èçæèåååèè [cn_gnu-extensions]_ çèåæåïåçïåäèåéååæääçã
>
> If we use that, at least for some of those references, it would probably
> be better to translate "dialect-options" (and similar terms) to Chinese.
>
> Thanks,
> Mauro

Thanks,
Mauro

This should do the work:

[PATCH] docs: zh_CN: avoid duplicate citation references

Documentation/process/management-style.rst:35: WARNING: duplicate label decisions, other instance in Documentation/translations/zh_CN/process/management-style.rst
Documentation/process/programming-language.rst:37: WARNING: duplicate citation c-language, other instance in Documentation/translations/zh_CN/process/programming-language.rst
Documentation/process/programming-language.rst:38: WARNING: duplicate citation gcc, other instance in Documentation/translations/zh_CN/process/programming-language.rst
Documentation/process/programming-language.rst:39: WARNING: duplicate citation clang, other instance in Documentation/translations/zh_CN/process/programming-language.rst
Documentation/process/programming-language.rst:40: WARNING: duplicate citation icc, other instance in Documentation/translations/zh_CN/process/programming-language.rst
Documentation/process/programming-language.rst:41: WARNING: duplicate citation gcc-c-dialect-options, other instance in Documentation/translations/zh_CN/process/programming-language.rst
Documentation/process/programming-language.rst:42: WARNING: duplicate citation gnu-extensions, other instance in Documentation/translations/zh_CN/process/programming-language.rst
Documentation/process/programming-language.rst:43: WARNING: duplicate citation gcc-attribute-syntax, other instance in Documentation/translations/zh_CN/process/programming-language.rst
Documentation/process/programming-language.rst:44: WARNING: duplicate citation n2049, other instance in Documentation/translations/zh_CN/process/programming-language.rst

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx>

diff --git a/Documentation/translations/zh_CN/process/management-style.rst b/Documentation/translations/zh_CN/process/management-style.rst
index a181fa56d19e..c6a5bb285797 100644
--- a/Documentation/translations/zh_CN/process/management-style.rst
+++ b/Documentation/translations/zh_CN/process/management-style.rst
@@ -28,7 +28,7 @@ Linuxåæççéæ

äçææïèéæï

-.. _decisions:
+.. _cn_decisions:

1ïåç
-------
@@ -108,7 +108,7 @@ Linuxåæççéæ
äæïääååääåæççèçååïæåèääèçæääææïäèèçää
æèçææïääèçèååçåæååäåãäåèæïçèäæçååæçïè
äèääçèçäæåéçãåæïâçèâçååäâäåéâçèçïåææ
-:ref:`decisions` æäçäåäåçäæã
+:ref:`cn_decisions` æäçäåäåçäæã

èéåæåäçåçèåï

diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
index 51fd4ef48ea1..22b0e68c8360 100644
--- a/Documentation/translations/zh_CN/process/programming-language.rst
+++ b/Documentation/translations/zh_CN/process/programming-language.rst
@@ -8,21 +8,21 @@
çåèèèè
============

-åææçCèè [c-language]_ çåçãæåçåèïåæéåæç ``gcc`` [gcc]_
-å ``-std=gnu89`` [gcc-c-dialect-options]_ äçèçïISO C90ç GNU æèï
+åææçCèè :ref:`c-language <cn_c-language>` çåçãæåçåèïåæéåæç ``gcc`` :ref:`gcc <cn_gcc>`
+å ``-std=gnu89`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` äçèçïISO C90ç GNU æèï
åæääC99çæï

-èçæèåååèè [gnu-extensions]_ çèåæåïåçïåäèåéååæääçã
+èçæèåååèè :ref:`gnu-extensions <cn_gnu-extensions>` çèåæåïåçïåäèåéååæääçã

-åääääççæïæäääç ``clang`` [clang]_ å ``icc`` [icc]_ çèåæ
+åääääççæïæäääç ``clang`` :ref:`clang <cn_clang>` å ``icc`` :ref:`icc <cn_icc>` çèåæ
çææïåçåçåææææèææåæïäéèçäæèäã

åæ
----

-åæäåæääççääåèæåæåæïattributesï [gcc-attribute-syntax]_
+åæäåæääççääåèæåæåæïattributesï :ref:`gcc-attribute-syntax <cn_gcc-attribute-syntax>`
åæåèååçåäçèäååèèåäïååéãåææçåïïèæéåèèèè
-éåçèæææïäåæåæåéåï [n2049]_
+éåçèæææïäåæåæåéåï :ref:`n2049 <cn_n2049>`

åæäæåäïåææåéçïåäææèäåæççèåäçåèçææççäçï
åäåéåèæææèççèæææ/èæææäåï
@@ -31,11 +31,42 @@
``__attribute__((__pure__))`` ïïäææåääçåäåéåå/æççäç, åä
èåé ``include/linux/compiler_attributes.h``

-.. [c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards
-.. [gcc] https://gcc.gnu.org
-.. [clang] https://clang.llvm.org
-.. [icc] https://software.intel.com/en-us/c-compilers
-.. [gcc-c-dialect-options] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
-.. [gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
-.. [gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
-.. [n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
+.. _cn_c-language:
+
+c-language
+ http://www.open-std.org/jtc1/sc22/wg14/www/standards
+
+.. _cn_gcc:
+
+gcc
+ https://gcc.gnu.org
+
+.. _cn_clang:
+
+clang
+ https://clang.llvm.org
+
+.. _cn_icc:
+
+icc
+ https://software.intel.com/en-us/c-compilers
+
+.. _cn_gcc-c-dialect-options:
+
+c-dialect-options
+ https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
+
+.. _cn_gnu-extensions:
+
+gnu-extensions
+ https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
+
+.. _cn_gcc-attribute-syntax:
+
+gcc-attribute-syntax
+ https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
+
+.. _cn_n2049:
+
+n2049
+ http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf