[PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst

Dongliang Mu posted 1 patch 1 month ago
.../zh_CN/process/programming-language.rst    | 78 +++++++------------
1 file changed, 30 insertions(+), 48 deletions(-)
[PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Dongliang Mu 1 month ago
Update to commit 0b02076f9953 ("docs: programming-language: add Rust
programming language section")

scripts/checktransupdate.py reports:

Documentation/translations/zh_CN/process/programming-language.rst
commit 0b02076f9953 ("docs: programming-language: add Rust programming
language section")
commit 38484a1d0c50 ("docs: programming-language: remove mention of the
Intel compiler")
2 commits needs resolving in total

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
---
v2->v3: fix warnings in the make htmldocs
v1->v2: revise the script name
 .../zh_CN/process/programming-language.rst    | 78 +++++++------------
 1 file changed, 30 insertions(+), 48 deletions(-)

diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
index fabdc338dbfb..95aa4829d78f 100644
--- a/Documentation/translations/zh_CN/process/programming-language.rst
+++ b/Documentation/translations/zh_CN/process/programming-language.rst
@@ -3,25 +3,22 @@
 :Original: :ref:`Documentation/process/programming-language.rst <programming_language>`
 :Translator: Alex Shi <alex.shi@linux.alibaba.com>
 
-.. _cn_programming_language:
-
 程序设计语言
 ============
 
-内核是用C语言 :ref:`c-language <cn_c-language>` 编写的。更准确地说,内核通常是用 :ref:`gcc <cn_gcc>`
-在 ``-std=gnu11`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` 下编译的:ISO C11的 GNU 方言
-
-这种方言包含对语言 :ref:`gnu-extensions <cn_gnu-extensions>` 的许多扩展,当然,它们许多都在内核中使用。
+内核是用 C 编程语言编写的 [zh_cn_c-language]_。更准确地说,内核通常使用 ``gcc`` [zh_cn_gcc]_ 编译,
+并且使用 ``-std=gnu11`` [zh_cn_gcc-c-dialect-options]_:这是 ISO C11 的 GNU 方言。
+``clang`` [zh_cn_clang]_ 也得到了支持,详见文档:
+:ref:`使用 Clang/LLVM 构建 Linux <kbuild_llvm>`。
 
-对于一些体系结构,有一些使用 :ref:`clang <cn_clang>` 和 :ref:`icc <cn_icc>` 编译内核
-的支持,尽管在编写此文档时还没有完成,仍需要第三方补丁。
+这种方言包含对 C 语言的许多扩展 [zh_cn_gnu-extensions]_,当然,它们许多都在内核中使用。
 
 属性
 ----
 
-在整个内核中使用的一个常见扩展是属性(attributes) :ref:`gcc-attribute-syntax <cn_gcc-attribute-syntax>`
+在整个内核中使用的一个常见扩展是属性(attributes) [zh_cn_gcc-attribute-syntax]_。
 属性允许将实现定义的语义引入语言实体(如变量、函数或类型),而无需对语言进行
-重大的语法更改(例如添加新关键字) :ref:`n2049 <cn_n2049>`
+重大的语法更改(例如添加新关键字) [zh_cn_n2049]_。
 
 在某些情况下,属性是可选的(即不支持这些属性的编译器仍然应该生成正确的代码,
 即使其速度较慢或执行的编译时检查/诊断次数不够)
@@ -30,42 +27,27 @@
 ``__attribute__((__pure__))`` ),以检测可以使用哪些关键字和/或缩短代码, 具体
 请参阅 ``include/linux/compiler_attributes.h``
 
-.. _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:
+Rust
+----
 
-n2049
-   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
+内核对 Rust 编程语言 [zh_cn_rust-language]_ 的支持是实验性的,并且可以通过配置选项
+``CONFIG_RUST`` 来启用。Rust 代码使用 ``rustc`` [zh_cn_rustc]_ 编译器在
+``--edition=2021`` [zh_cn_rust-editions]_ 选项下进行编译。版本(Editions)是一种
+在语言中引入非后向兼容的小型变更的方式。
+
+除此之外,内核中还使用了一些不稳定的特性 [zh_cn_rust-unstable-features]_。这些不稳定
+的特性将来可能会发生变化,因此,一个重要的目标是达到仅使用稳定特性的程度。
+
+具体请参阅 Documentation/rust/index.rst
+
+.. [zh_cn_c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards
+.. [zh_cn_gcc] https://gcc.gnu.org
+.. [zh_cn_clang] https://clang.llvm.org
+.. [zh_cn_gcc-c-dialect-options] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
+.. [zh_cn_gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
+.. [zh_cn_gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
+.. [zh_cn_n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
+.. [zh_cn_rust-language] https://www.rust-lang.org
+.. [zh_cn_rustc] https://doc.rust-lang.org/rustc/
+.. [zh_cn_rust-editions] https://doc.rust-lang.org/edition-guide/editions/
+.. [zh_cn_rust-unstable-features] https://github.com/Rust-for-Linux/linux/issues/2
-- 
2.43.0

Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Jonathan Corbet 1 month ago
Dongliang Mu <dzm91@hust.edu.cn> writes:

> Update to commit 0b02076f9953 ("docs: programming-language: add Rust
> programming language section")
>
> scripts/checktransupdate.py reports:
>
> Documentation/translations/zh_CN/process/programming-language.rst
> commit 0b02076f9953 ("docs: programming-language: add Rust programming
> language section")
> commit 38484a1d0c50 ("docs: programming-language: remove mention of the
> Intel compiler")
> 2 commits needs resolving in total
>
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
> v2->v3: fix warnings in the make htmldocs

This still generates warnings:

Documentation/translations/zh_CN/mm/physical_memory.rst:131: WARNING: duplicate label nodes, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst
Documentation/translations/zh_CN/mm/physical_memory.rst:325: WARNING: duplicate label zones, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst
Documentation/translations/zh_CN/mm/physical_memory.rst:334: WARNING: duplicate label pages, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst
Documentation/translations/zh_CN/mm/physical_memory.rst:350: WARNING: duplicate label initialization, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst

jon
Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Jonathan Corbet 1 month ago
Jonathan Corbet <corbet@lwn.net> writes:

> This still generates warnings:
>
> Documentation/translations/zh_CN/mm/physical_memory.rst:131: WARNING: duplicate label nodes, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst
> Documentation/translations/zh_CN/mm/physical_memory.rst:325: WARNING: duplicate label zones, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst
> Documentation/translations/zh_CN/mm/physical_memory.rst:334: WARNING: duplicate label pages, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst
> Documentation/translations/zh_CN/mm/physical_memory.rst:350: WARNING: duplicate label initialization, other instance in /home/corbet/kernel/Documentation/mm/physical_memory.rst

My apologies - that wasn't your patch at all - that's what I get for
trying to do things in a hurry.  Sorry for the noise.

jon
Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Jonathan Corbet 1 month ago
Dongliang Mu <dzm91@hust.edu.cn> writes:

> Update to commit 0b02076f9953 ("docs: programming-language: add Rust
> programming language section")
>
> scripts/checktransupdate.py reports:
>
> Documentation/translations/zh_CN/process/programming-language.rst
> commit 0b02076f9953 ("docs: programming-language: add Rust programming
> language section")
> commit 38484a1d0c50 ("docs: programming-language: remove mention of the
> Intel compiler")
> 2 commits needs resolving in total
>
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
> v2->v3: fix warnings in the make htmldocs
> v1->v2: revise the script name
>  .../zh_CN/process/programming-language.rst    | 78 +++++++------------
>  1 file changed, 30 insertions(+), 48 deletions(-)

Applied, thanks.

jon
Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Alex Shi 1 month ago

On 10/23/24 14:27, Dongliang Mu wrote:
> Update to commit 0b02076f9953 ("docs: programming-language: add Rust
> programming language section")
> 
> scripts/checktransupdate.py reports:
> 
> Documentation/translations/zh_CN/process/programming-language.rst
> commit 0b02076f9953 ("docs: programming-language: add Rust programming
> language section")
> commit 38484a1d0c50 ("docs: programming-language: remove mention of the
> Intel compiler")
> 2 commits needs resolving in total
> 
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
> v2->v3: fix warnings in the make htmldocs
> v1->v2: revise the script name
>  .../zh_CN/process/programming-language.rst    | 78 +++++++------------
>  1 file changed, 30 insertions(+), 48 deletions(-)
> 
> diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
> index fabdc338dbfb..95aa4829d78f 100644
> --- a/Documentation/translations/zh_CN/process/programming-language.rst
> +++ b/Documentation/translations/zh_CN/process/programming-language.rst
> @@ -3,25 +3,22 @@
>  :Original: :ref:`Documentation/process/programming-language.rst <programming_language>`
>  :Translator: Alex Shi <alex.shi@linux.alibaba.com>
>  
> -.. _cn_programming_language:
> -
>  程序设计语言
>  ============
>  
> -内核是用C语言 :ref:`c-language <cn_c-language>` 编写的。更准确地说,内核通常是用 :ref:`gcc <cn_gcc>`
> -在 ``-std=gnu11`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` 下编译的:ISO C11的 GNU 方言
> -
> -这种方言包含对语言 :ref:`gnu-extensions <cn_gnu-extensions>` 的许多扩展,当然,它们许多都在内核中使用。
> +内核是用 C 编程语言编写的 [zh_cn_c-language]_。更准确地说,内核通常使用 ``gcc`` [zh_cn_gcc]_ 编译,
> +并且使用 ``-std=gnu11`` [zh_cn_gcc-c-dialect-options]_:这是 ISO C11 的 GNU 方言。
> +``clang`` [zh_cn_clang]_ 也得到了支持,详见文档:
> +:ref:`使用 Clang/LLVM 构建 Linux <kbuild_llvm>`。
>  
> -对于一些体系结构,有一些使用 :ref:`clang <cn_clang>` 和 :ref:`icc <cn_icc>` 编译内核
> -的支持,尽管在编写此文档时还没有完成,仍需要第三方补丁。
> +这种方言包含对 C 语言的许多扩展 [zh_cn_gnu-extensions]_,当然,它们许多都在内核中使用。
>  
>  属性
>  ----
>  
> -在整个内核中使用的一个常见扩展是属性(attributes) :ref:`gcc-attribute-syntax <cn_gcc-attribute-syntax>`
> +在整个内核中使用的一个常见扩展是属性(attributes) [zh_cn_gcc-attribute-syntax]_。
>  属性允许将实现定义的语义引入语言实体(如变量、函数或类型),而无需对语言进行
> -重大的语法更改(例如添加新关键字) :ref:`n2049 <cn_n2049>`
> +重大的语法更改(例如添加新关键字) [zh_cn_n2049]_。
>  
>  在某些情况下,属性是可选的(即不支持这些属性的编译器仍然应该生成正确的代码,
>  即使其速度较慢或执行的编译时检查/诊断次数不够)
> @@ -30,42 +27,27 @@
>  ``__attribute__((__pure__))`` ),以检测可以使用哪些关键字和/或缩短代码, 具体
>  请参阅 ``include/linux/compiler_attributes.h``
>  
> -.. _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:
> +Rust
> +----
>  
> -n2049
> -   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
> +内核对 Rust 编程语言 [zh_cn_rust-language]_ 的支持是实验性的,并且可以通过配置选项
> +``CONFIG_RUST`` 来启用。Rust 代码使用 ``rustc`` [zh_cn_rustc]_ 编译器在
> +``--edition=2021`` [zh_cn_rust-editions]_ 选项下进行编译。版本(Editions)是一种
> +在语言中引入非后向兼容的小型变更的方式。
> +
> +除此之外,内核中还使用了一些不稳定的特性 [zh_cn_rust-unstable-features]_。这些不稳定
> +的特性将来可能会发生变化,因此,一个重要的目标是达到仅使用稳定特性的程度。
> +
> +具体请参阅 Documentation/rust/index.rst
> +
> +.. [zh_cn_c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards
> +.. [zh_cn_gcc] https://gcc.gnu.org
> +.. [zh_cn_clang] https://clang.llvm.org
> +.. [zh_cn_gcc-c-dialect-options] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
> +.. [zh_cn_gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
> +.. [zh_cn_gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
> +.. [zh_cn_n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
> +.. [zh_cn_rust-language] https://www.rust-lang.org
> +.. [zh_cn_rustc] https://doc.rust-lang.org/rustc/
> +.. [zh_cn_rust-editions] https://doc.rust-lang.org/edition-guide/editions/
> +.. [zh_cn_rust-unstable-features] https://github.com/Rust-for-Linux/linux/issues/2

Hi Dongliang,

Good job! Most of translation are good.
Just the above doc seems still English version, give them a zh_cn name may cause misunderstand?
 
Thanks
Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Dongliang Mu 1 month ago
On 2024/10/24 10:21, Alex Shi wrote:
>
> On 10/23/24 14:27, Dongliang Mu wrote:
>> Update to commit 0b02076f9953 ("docs: programming-language: add Rust
>> programming language section")
>>
>> scripts/checktransupdate.py reports:
>>
>> Documentation/translations/zh_CN/process/programming-language.rst
>> commit 0b02076f9953 ("docs: programming-language: add Rust programming
>> language section")
>> commit 38484a1d0c50 ("docs: programming-language: remove mention of the
>> Intel compiler")
>> 2 commits needs resolving in total
>>
>> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
>> ---
>> v2->v3: fix warnings in the make htmldocs
>> v1->v2: revise the script name
>>   .../zh_CN/process/programming-language.rst    | 78 +++++++------------
>>   1 file changed, 30 insertions(+), 48 deletions(-)
>>
>> diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
>> index fabdc338dbfb..95aa4829d78f 100644
>> --- a/Documentation/translations/zh_CN/process/programming-language.rst
>> +++ b/Documentation/translations/zh_CN/process/programming-language.rst
>> @@ -3,25 +3,22 @@
>>   :Original: :ref:`Documentation/process/programming-language.rst <programming_language>`
>>   :Translator: Alex Shi <alex.shi@linux.alibaba.com>
>>   
>> -.. _cn_programming_language:
>> -
>>   程序设计语言
>>   ============
>>   
>> -内核是用C语言 :ref:`c-language <cn_c-language>` 编写的。更准确地说,内核通常是用 :ref:`gcc <cn_gcc>`
>> -在 ``-std=gnu11`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` 下编译的:ISO C11的 GNU 方言
>> -
>> -这种方言包含对语言 :ref:`gnu-extensions <cn_gnu-extensions>` 的许多扩展,当然,它们许多都在内核中使用。
>> +内核是用 C 编程语言编写的 [zh_cn_c-language]_。更准确地说,内核通常使用 ``gcc`` [zh_cn_gcc]_ 编译,
>> +并且使用 ``-std=gnu11`` [zh_cn_gcc-c-dialect-options]_:这是 ISO C11 的 GNU 方言。
>> +``clang`` [zh_cn_clang]_ 也得到了支持,详见文档:
>> +:ref:`使用 Clang/LLVM 构建 Linux <kbuild_llvm>`。
>>   
>> -对于一些体系结构,有一些使用 :ref:`clang <cn_clang>` 和 :ref:`icc <cn_icc>` 编译内核
>> -的支持,尽管在编写此文档时还没有完成,仍需要第三方补丁。
>> +这种方言包含对 C 语言的许多扩展 [zh_cn_gnu-extensions]_,当然,它们许多都在内核中使用。
>>   
>>   属性
>>   ----
>>   
>> -在整个内核中使用的一个常见扩展是属性(attributes) :ref:`gcc-attribute-syntax <cn_gcc-attribute-syntax>`
>> +在整个内核中使用的一个常见扩展是属性(attributes) [zh_cn_gcc-attribute-syntax]_。
>>   属性允许将实现定义的语义引入语言实体(如变量、函数或类型),而无需对语言进行
>> -重大的语法更改(例如添加新关键字) :ref:`n2049 <cn_n2049>`
>> +重大的语法更改(例如添加新关键字) [zh_cn_n2049]_。
>>   
>>   在某些情况下,属性是可选的(即不支持这些属性的编译器仍然应该生成正确的代码,
>>   即使其速度较慢或执行的编译时检查/诊断次数不够)
>> @@ -30,42 +27,27 @@
>>   ``__attribute__((__pure__))`` ),以检测可以使用哪些关键字和/或缩短代码, 具体
>>   请参阅 ``include/linux/compiler_attributes.h``
>>   
>> -.. _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:
>> +Rust
>> +----
>>   
>> -n2049
>> -   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
>> +内核对 Rust 编程语言 [zh_cn_rust-language]_ 的支持是实验性的,并且可以通过配置选项
>> +``CONFIG_RUST`` 来启用。Rust 代码使用 ``rustc`` [zh_cn_rustc]_ 编译器在
>> +``--edition=2021`` [zh_cn_rust-editions]_ 选项下进行编译。版本(Editions)是一种
>> +在语言中引入非后向兼容的小型变更的方式。
>> +
>> +除此之外,内核中还使用了一些不稳定的特性 [zh_cn_rust-unstable-features]_。这些不稳定
>> +的特性将来可能会发生变化,因此,一个重要的目标是达到仅使用稳定特性的程度。
>> +
>> +具体请参阅 Documentation/rust/index.rst
>> +
>> +.. [zh_cn_c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards
>> +.. [zh_cn_gcc] https://gcc.gnu.org
>> +.. [zh_cn_clang] https://clang.llvm.org
>> +.. [zh_cn_gcc-c-dialect-options] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
>> +.. [zh_cn_gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
>> +.. [zh_cn_gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
>> +.. [zh_cn_n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
>> +.. [zh_cn_rust-language] https://www.rust-lang.org
>> +.. [zh_cn_rustc] https://doc.rust-lang.org/rustc/
>> +.. [zh_cn_rust-editions] https://doc.rust-lang.org/edition-guide/editions/
>> +.. [zh_cn_rust-unstable-features] https://github.com/Rust-for-Linux/linux/issues/2
> Hi Dongliang,
>
> Good job! Most of translation are good.
> Just the above doc seems still English version, give them a zh_cn name may cause misunderstand?

Oh, I see. However, you cannot use gcc or rustc since it already exists 
in the English documents. We need another name to make sphinx happy. 
Therefore, why do not we directly use the final version of name? :)

Correct me if I make any misunderstanding.

Dongliang Mu

>   
> Thanks

Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Alex Shi 1 month ago

On 10/24/24 10:30, Dongliang Mu wrote:
> 
> On 2024/10/24 10:21, Alex Shi wrote:
>>
>> On 10/23/24 14:27, Dongliang Mu wrote:
>>> Update to commit 0b02076f9953 ("docs: programming-language: add Rust
>>> programming language section")
>>>
>>> scripts/checktransupdate.py reports:
>>>
>>> Documentation/translations/zh_CN/process/programming-language.rst
>>> commit 0b02076f9953 ("docs: programming-language: add Rust programming
>>> language section")
>>> commit 38484a1d0c50 ("docs: programming-language: remove mention of the
>>> Intel compiler")
>>> 2 commits needs resolving in total
>>>
>>> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
>>> ---
>>> v2->v3: fix warnings in the make htmldocs
>>> v1->v2: revise the script name
>>>   .../zh_CN/process/programming-language.rst    | 78 +++++++------------
>>>   1 file changed, 30 insertions(+), 48 deletions(-)
>>>
>>> diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
>>> index fabdc338dbfb..95aa4829d78f 100644
>>> --- a/Documentation/translations/zh_CN/process/programming-language.rst
>>> +++ b/Documentation/translations/zh_CN/process/programming-language.rst
>>> @@ -3,25 +3,22 @@
>>>   :Original: :ref:`Documentation/process/programming-language.rst <programming_language>`
>>>   :Translator: Alex Shi <alex.shi@linux.alibaba.com>
>>>   -.. _cn_programming_language:
>>> -
>>>   程序设计语言
>>>   ============
>>>   -内核是用C语言 :ref:`c-language <cn_c-language>` 编写的。更准确地说,内核通常是用 :ref:`gcc <cn_gcc>`
>>> -在 ``-std=gnu11`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` 下编译的:ISO C11的 GNU 方言
>>> -
>>> -这种方言包含对语言 :ref:`gnu-extensions <cn_gnu-extensions>` 的许多扩展,当然,它们许多都在内核中使用。
>>> +内核是用 C 编程语言编写的 [zh_cn_c-language]_。更准确地说,内核通常使用 ``gcc`` [zh_cn_gcc]_ 编译,
>>> +并且使用 ``-std=gnu11`` [zh_cn_gcc-c-dialect-options]_:这是 ISO C11 的 GNU 方言。
>>> +``clang`` [zh_cn_clang]_ 也得到了支持,详见文档:
>>> +:ref:`使用 Clang/LLVM 构建 Linux <kbuild_llvm>`。
>>>   -对于一些体系结构,有一些使用 :ref:`clang <cn_clang>` 和 :ref:`icc <cn_icc>` 编译内核
>>> -的支持,尽管在编写此文档时还没有完成,仍需要第三方补丁。
>>> +这种方言包含对 C 语言的许多扩展 [zh_cn_gnu-extensions]_,当然,它们许多都在内核中使用。
>>>     属性
>>>   ----
>>>   -在整个内核中使用的一个常见扩展是属性(attributes) :ref:`gcc-attribute-syntax <cn_gcc-attribute-syntax>`
>>> +在整个内核中使用的一个常见扩展是属性(attributes) [zh_cn_gcc-attribute-syntax]_。
>>>   属性允许将实现定义的语义引入语言实体(如变量、函数或类型),而无需对语言进行
>>> -重大的语法更改(例如添加新关键字) :ref:`n2049 <cn_n2049>`
>>> +重大的语法更改(例如添加新关键字) [zh_cn_n2049]_。
>>>     在某些情况下,属性是可选的(即不支持这些属性的编译器仍然应该生成正确的代码,
>>>   即使其速度较慢或执行的编译时检查/诊断次数不够)
>>> @@ -30,42 +27,27 @@
>>>   ``__attribute__((__pure__))`` ),以检测可以使用哪些关键字和/或缩短代码, 具体
>>>   请参阅 ``include/linux/compiler_attributes.h``
>>>   -.. _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:
>>> +Rust
>>> +----
>>>   -n2049
>>> -   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
>>> +内核对 Rust 编程语言 [zh_cn_rust-language]_ 的支持是实验性的,并且可以通过配置选项
>>> +``CONFIG_RUST`` 来启用。Rust 代码使用 ``rustc`` [zh_cn_rustc]_ 编译器在
>>> +``--edition=2021`` [zh_cn_rust-editions]_ 选项下进行编译。版本(Editions)是一种
>>> +在语言中引入非后向兼容的小型变更的方式。
>>> +
>>> +除此之外,内核中还使用了一些不稳定的特性 [zh_cn_rust-unstable-features]_。这些不稳定
>>> +的特性将来可能会发生变化,因此,一个重要的目标是达到仅使用稳定特性的程度。
>>> +
>>> +具体请参阅 Documentation/rust/index.rst
>>> +
>>> +.. [zh_cn_c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards
>>> +.. [zh_cn_gcc] https://gcc.gnu.org
>>> +.. [zh_cn_clang] https://clang.llvm.org
>>> +.. [zh_cn_gcc-c-dialect-options] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
>>> +.. [zh_cn_gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
>>> +.. [zh_cn_gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
>>> +.. [zh_cn_n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
>>> +.. [zh_cn_rust-language] https://www.rust-lang.org
>>> +.. [zh_cn_rustc] https://doc.rust-lang.org/rustc/
>>> +.. [zh_cn_rust-editions] https://doc.rust-lang.org/edition-guide/editions/
>>> +.. [zh_cn_rust-unstable-features] https://github.com/Rust-for-Linux/linux/issues/2
>> Hi Dongliang,
>>
>> Good job! Most of translation are good.
>> Just the above doc seems still English version, give them a zh_cn name may cause misunderstand?
> 
> Oh, I see. However, you cannot use gcc or rustc since it already exists in the English documents. We need another name to make sphinx happy. Therefore, why do not we directly use the final version of name? :)
> 
Uh, is it possible to use English version 'gcc' links in this doc? Otherwise,it make sense too. 

Thanks

> Correct me if I make any misunderstanding.
> 
> Dongliang Mu
> 
>>   Thanks
> 
Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Dongliang Mu 1 month ago
On Thu, Oct 24, 2024 at 10:41 AM Alex Shi <seakeel@gmail.com> wrote:
>
>
>
> On 10/24/24 10:30, Dongliang Mu wrote:
> >
> > On 2024/10/24 10:21, Alex Shi wrote:
> >>
> >> On 10/23/24 14:27, Dongliang Mu wrote:
> >>> Update to commit 0b02076f9953 ("docs: programming-language: add Rust
> >>> programming language section")
> >>>
> >>> scripts/checktransupdate.py reports:
> >>>
> >>> Documentation/translations/zh_CN/process/programming-language.rst
> >>> commit 0b02076f9953 ("docs: programming-language: add Rust programming
> >>> language section")
> >>> commit 38484a1d0c50 ("docs: programming-language: remove mention of the
> >>> Intel compiler")
> >>> 2 commits needs resolving in total
> >>>
> >>> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> >>> ---
> >>> v2->v3: fix warnings in the make htmldocs
> >>> v1->v2: revise the script name
> >>>   .../zh_CN/process/programming-language.rst    | 78 +++++++------------
> >>>   1 file changed, 30 insertions(+), 48 deletions(-)
> >>>
> >>> diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst
> >>> index fabdc338dbfb..95aa4829d78f 100644
> >>> --- a/Documentation/translations/zh_CN/process/programming-language.rst
> >>> +++ b/Documentation/translations/zh_CN/process/programming-language.rst
> >>> @@ -3,25 +3,22 @@
> >>>   :Original: :ref:`Documentation/process/programming-language.rst <programming_language>`
> >>>   :Translator: Alex Shi <alex.shi@linux.alibaba.com>
> >>>   -.. _cn_programming_language:
> >>> -
> >>>   程序设计语言
> >>>   ============
> >>>   -内核是用C语言 :ref:`c-language <cn_c-language>` 编写的。更准确地说,内核通常是用 :ref:`gcc <cn_gcc>`
> >>> -在 ``-std=gnu11`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` 下编译的:ISO C11的 GNU 方言
> >>> -
> >>> -这种方言包含对语言 :ref:`gnu-extensions <cn_gnu-extensions>` 的许多扩展,当然,它们许多都在内核中使用。
> >>> +内核是用 C 编程语言编写的 [zh_cn_c-language]_。更准确地说,内核通常使用 ``gcc`` [zh_cn_gcc]_ 编译,
> >>> +并且使用 ``-std=gnu11`` [zh_cn_gcc-c-dialect-options]_:这是 ISO C11 的 GNU 方言。
> >>> +``clang`` [zh_cn_clang]_ 也得到了支持,详见文档:
> >>> +:ref:`使用 Clang/LLVM 构建 Linux <kbuild_llvm>`。
> >>>   -对于一些体系结构,有一些使用 :ref:`clang <cn_clang>` 和 :ref:`icc <cn_icc>` 编译内核
> >>> -的支持,尽管在编写此文档时还没有完成,仍需要第三方补丁。
> >>> +这种方言包含对 C 语言的许多扩展 [zh_cn_gnu-extensions]_,当然,它们许多都在内核中使用。
> >>>     属性
> >>>   ----
> >>>   -在整个内核中使用的一个常见扩展是属性(attributes) :ref:`gcc-attribute-syntax <cn_gcc-attribute-syntax>`
> >>> +在整个内核中使用的一个常见扩展是属性(attributes) [zh_cn_gcc-attribute-syntax]_。
> >>>   属性允许将实现定义的语义引入语言实体(如变量、函数或类型),而无需对语言进行
> >>> -重大的语法更改(例如添加新关键字) :ref:`n2049 <cn_n2049>`
> >>> +重大的语法更改(例如添加新关键字) [zh_cn_n2049]_。
> >>>     在某些情况下,属性是可选的(即不支持这些属性的编译器仍然应该生成正确的代码,
> >>>   即使其速度较慢或执行的编译时检查/诊断次数不够)
> >>> @@ -30,42 +27,27 @@
> >>>   ``__attribute__((__pure__))`` ),以检测可以使用哪些关键字和/或缩短代码, 具体
> >>>   请参阅 ``include/linux/compiler_attributes.h``
> >>>   -.. _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:
> >>> +Rust
> >>> +----
> >>>   -n2049
> >>> -   http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
> >>> +内核对 Rust 编程语言 [zh_cn_rust-language]_ 的支持是实验性的,并且可以通过配置选项
> >>> +``CONFIG_RUST`` 来启用。Rust 代码使用 ``rustc`` [zh_cn_rustc]_ 编译器在
> >>> +``--edition=2021`` [zh_cn_rust-editions]_ 选项下进行编译。版本(Editions)是一种
> >>> +在语言中引入非后向兼容的小型变更的方式。
> >>> +
> >>> +除此之外,内核中还使用了一些不稳定的特性 [zh_cn_rust-unstable-features]_。这些不稳定
> >>> +的特性将来可能会发生变化,因此,一个重要的目标是达到仅使用稳定特性的程度。
> >>> +
> >>> +具体请参阅 Documentation/rust/index.rst
> >>> +
> >>> +.. [zh_cn_c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards
> >>> +.. [zh_cn_gcc] https://gcc.gnu.org
> >>> +.. [zh_cn_clang] https://clang.llvm.org
> >>> +.. [zh_cn_gcc-c-dialect-options] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
> >>> +.. [zh_cn_gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
> >>> +.. [zh_cn_gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
> >>> +.. [zh_cn_n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf
> >>> +.. [zh_cn_rust-language] https://www.rust-lang.org
> >>> +.. [zh_cn_rustc] https://doc.rust-lang.org/rustc/
> >>> +.. [zh_cn_rust-editions] https://doc.rust-lang.org/edition-guide/editions/
> >>> +.. [zh_cn_rust-unstable-features] https://github.com/Rust-for-Linux/linux/issues/2
> >> Hi Dongliang,
> >>
> >> Good job! Most of translation are good.
> >> Just the above doc seems still English version, give them a zh_cn name may cause misunderstand?
> >
> > Oh, I see. However, you cannot use gcc or rustc since it already exists in the English documents. We need another name to make sphinx happy. Therefore, why do not we directly use the final version of name? :)
> >
> Uh, is it possible to use English version 'gcc' links in this doc? Otherwise,it make sense too.
>

https://lore.kernel.org/all/bae3c59c-39a5-4daa-b37e-bbf077d57643@hust.edu.cn/T/#m8a948b24401404806f53e086f57856cf3a56a490

v2 patch triggers a warning due to duplicate links. So I crafted a v3
version to use zh_cn prefix before each link

> Thanks
>
> > Correct me if I make any misunderstanding.
> >
> > Dongliang Mu
> >
> >>   Thanks
> >
>
Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Alex Shi 1 month ago

On 10/24/24 10:51, Dongliang Mu wrote:
>>>> Hi Dongliang,
>>>>
>>>> Good job! Most of translation are good.
>>>> Just the above doc seems still English version, give them a zh_cn name may cause misunderstand?
>>> Oh, I see. However, you cannot use gcc or rustc since it already exists in the English documents. We need another name to make sphinx happy. Therefore, why do not we directly use the final version of name? :)
>>>
>> Uh, is it possible to use English version 'gcc' links in this doc? Otherwise,it make sense too.
>>
> https://lore.kernel.org/all/bae3c59c-39a5-4daa-b37e-bbf077d57643@hust.edu.cn/T/#m8a948b24401404806f53e086f57856cf3a56a490
> 
> v2 patch triggers a warning due to duplicate links. So I crafted a v3
> version to use zh_cn prefix before each link

OK. That's fine for this patch. But for long term view, it's better to find a way for duplicate links.

Reviewed-by: Alex Shi <alexs@kernel.org>
Re: [PATCH v3] docs/zh_CN: update the translation of process/programming-language.rst
Posted by Dongliang Mu 1 month ago
On Thu, Oct 24, 2024 at 11:02 AM Alex Shi <seakeel@gmail.com> wrote:
>
>
>
> On 10/24/24 10:51, Dongliang Mu wrote:
> >>>> Hi Dongliang,
> >>>>
> >>>> Good job! Most of translation are good.
> >>>> Just the above doc seems still English version, give them a zh_cn name may cause misunderstand?
> >>> Oh, I see. However, you cannot use gcc or rustc since it already exists in the English documents. We need another name to make sphinx happy. Therefore, why do not we directly use the final version of name? :)
> >>>
> >> Uh, is it possible to use English version 'gcc' links in this doc? Otherwise,it make sense too.
> >>
> > https://lore.kernel.org/all/bae3c59c-39a5-4daa-b37e-bbf077d57643@hust.edu.cn/T/#m8a948b24401404806f53e086f57856cf3a56a490
> >
> > v2 patch triggers a warning due to duplicate links. So I crafted a v3
> > version to use zh_cn prefix before each link
>
> OK. That's fine for this patch. But for long term view, it's better to find a way for duplicate links.

Yes, I would like to keep it the same with English for now. Then find
the Chinese version or translate in our translation team.

>
> Reviewed-by: Alex Shi <alexs@kernel.org>