Is there anyone like me who wants to add translation functionality to Rust's documents?

Is there anyone like me who wants to add translation functionality to Rust's documents?

Whether it's Docs.rs, cargo doc, or function documentation comments, Rust does not have internationalization (translation) capabilities.

Can anyone add a translation project?
I thought about designing document documentation like this:

/// #[lang.en]
/// This is the English version of the function document
/// #[lang.zh]
/// 这是函数的中文版注释
fn main(){}

Then add corresponding language conversion buttons on the Docs.rs and Rustdoc web pages


不论是Docs.rs还是cargo doc还是函数的文档注释,rust都没有国际化(翻译)的功能
我想开一个全部翻译的项目!
我设想在注释上使用标记来提供不同的文档的翻译版本。
像这样:

/// #[lang.en]
/// This is the English version of the function document
/// #[lang.zh]
/// 这是函数的中文版注释
fn main(){}

然后rustdoc在生成时自动将对应的语言转换成对应的网页。最后在用一个语言选择按钮放在网页上就行了。

But I only have ideas and don't know how to implement them

Can anyone help me?Although I don't have much time, I will do my best to help.To make Rust better.
有没有大佬帮忙的?我比较菜,只会翻译

It's almost impossible to rely on translation made by human beings.
As a frequent translator, I find very few people do read the translated materials.

Modern translation tools are very convenient, although their accuracy is worrying, they greatly reduce reading barriers in a low-cost (mostly cost free) way. Manual translation verification is time-consuming and labor-intensive, and no one is looking at it, therefore it unnecessary to perform.
(现代翻译工具很方便,虽然它们的准确率堪忧,但至少以低成本(大部分时候无成本)的方式,极大地减少阅读障碍。人工校验耗时耗力,又没人看,更没必要。)懒得用英文回答了,凑合往下看吧。

针对库级别的翻译也有人实践过,GitHub - wtklbm/rust-library-i18n: Rust 核心库和标准库中文翻译,可作为 IDE 工具的智能提示,并生成本地 API 文档 似乎以前在对标准库机翻的基础上进行少许人工翻译,但这种模式根本不可持续。

我最近发现了一个双语浏览器翻译工具 https://immersivetranslate.com/ ,每段原文之后就是译文,而不是整个网页全部是译文,可以辅助阅读英文。预览效果

2 Likes

说的也是 :upside_down_face:人工翻译成本太大