cargo-binstall & cargo-build: add Simplified and Traditional Chinese translation (#22044)

This commit is contained in:
Ninzero
2026-04-15 16:38:09 +08:00
committed by GitHub
parent d93e4d145f
commit 4842f2544d
11 changed files with 117 additions and 27 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
> 编译并执行基准测试。
> 更多信息:<https://doc.rust-lang.org/cargo/commands/cargo-bench.html>。
- 执行包的所有基准测试:
- 执行软件包的所有基准测试:
`cargo bench`
@@ -31,6 +31,6 @@
`cargo bench --bins`
- 对包的库(lib)进行基准测试:
-软件包的库(lib)进行基准测试:
`cargo bench --lib`
+17
View File
@@ -0,0 +1,17 @@
# cargo binstall
> 从 CI 产物安装 Rust 二进制文件。
> 如果没有可用的二进制文件,则回退到 `cargo install`(从源代码安装)。
> 更多信息:<https://github.com/cargo-bins/cargo-binstall>。
- 从 <https://crates.io> 安装一个软件包:
`cargo binstall {{软件包}}`
- 安装指定版本的软件包(默认为最新版本):
`cargo binstall {{软件包}}@{{版本号}}`
- 安装软件包并禁用确认提示:
`cargo binstall {{[-y|--no-confirm]}} {{软件包}}`
+5 -5
View File
@@ -1,9 +1,9 @@
# cargo build
> 编译本地包及其所有依赖项。
> 编译本地软件包及其所有依赖项。
> 更多信息:<https://doc.rust-lang.org/cargo/commands/cargo-build.html>。
- 在本地路径中构建由 `Cargo.toml` 清单文件定义的一个或多个包:
- 在本地路径中构建由 `Cargo.toml` 清单文件定义的一个或多个软件包:
`cargo {{[b|build]}}`
@@ -15,13 +15,13 @@
`cargo {{[b|build]}} --locked`
- 构建工作区中的所有包:
- 构建工作区中的所有软件包:
`cargo {{[b|build]}} --workspace`
- 构建特定的包:
- 构建特定的软件包:
`cargo {{[b|build]}} {{[-p|--package]}} {{包}}`
`cargo {{[b|build]}} {{[-p|--package]}} {{软件包}}`
- 仅构建指定的二进制文件:
+4 -4
View File
@@ -1,9 +1,9 @@
# cargo check
> 检查本地软件包及其所有依赖是否有错误。
> 检查本地软件包及其所有依赖是否有错误。
> 更多信息:<https://doc.rust-lang.org/cargo/commands/cargo-check.html>。
- 检查当前包:
- 检查当前软件包:
`cargo {{[c|check]}}`
@@ -15,10 +15,10 @@
`cargo {{[c|check]}} --test {{integration_test1}}`
- 使用 `feature1``feature2` 功能检查当前包:
- 使用 `feature1``feature2` 功能检查当前软件包:
`cargo {{[c|check]}} {{[-F|--features]}} {{feature1,feature2}}`
- 禁用默认功能后检测当前包:
- 禁用默认功能后检测当前软件包:
`cargo {{[c|check]}} --no-default-features`
+6 -6
View File
@@ -3,11 +3,11 @@
> 构建并安装一个 Rust 二进制文件。
> 更多信息:<https://doc.rust-lang.org/cargo/commands/cargo-install.html>。
- 从 <https://crates.io> 安装一个包 (版本是可选的,默认为最新版本):
- 从 <https://crates.io> 安装一个软件包 (版本是可选的,默认为最新版本):
`cargo install {{包}}@{{版本号}}`
`cargo install {{软件包}}@{{版本号}}`
- 从指定的 Git 仓库安装一个包:
- 从指定的 Git 仓库安装一个软件包:
`cargo install --git {{仓库 URL}}`
@@ -15,10 +15,10 @@
`cargo install --git {{仓库 URL}} --{{branch|tag|rev}} {{branch_name|tag|commit_hash}}`
- 从本地目录安装一个包:
- 从本地目录安装一个软件包:
`cargo install --path {{路径/到/目录}}`
`cargo install --path {{路径/到/软件包}}`
- 列出所有已安装的包及其版本:
- 列出所有已安装的软件包及其版本:
`cargo install --list`
+1 -1
View File
@@ -4,7 +4,7 @@
> 此命令也有关于其子命令的文件,例如:`build`.
> 更多信息:<https://doc.rust-lang.org/stable/cargo/>。
- 搜索包:
- 搜索包crate
`cargo search {{搜索关键词}}`
+17
View File
@@ -0,0 +1,17 @@
# cargo binstall
> 從 CI 產物安裝 Rust 二進位檔案。
> 如果沒有可用的二進位檔案,則回退到 `cargo install`(從原始碼安裝)。
> 更多資訊:<https://github.com/cargo-bins/cargo-binstall>。
- 從 <https://crates.io> 安裝一個套件:
`cargo binstall {{套件}}`
- 安裝指定版本的套件(預設為最新版本):
`cargo binstall {{套件}}@{{版本號}}`
- 安裝套件並停用確認提示:
`cargo binstall {{[-y|--no-confirm]}} {{套件}}`
+32
View File
@@ -0,0 +1,32 @@
# cargo build
> 編譯本地套件及其所有相依項。
> 更多資訊:<https://doc.rust-lang.org/cargo/commands/cargo-build.html>。
- 在本地路徑中組建由 `Cargo.toml` 清單檔案定義的一個或多個套件:
`cargo {{[b|build]}}`
- 以 release 模式組建,並進行最佳化:
`cargo {{[b|build]}} {{[-r|--release]}}`
- 要求 `Cargo.lock` 檔案為最新版本:
`cargo {{[b|build]}} --locked`
- 組建工作區中的所有套件:
`cargo {{[b|build]}} --workspace`
- 組建特定的套件:
`cargo {{[b|build]}} {{[-p|--package]}} {{套件}}`
- 僅組建指定的二進位檔案:
`cargo {{[b|build]}} --bin {{名稱}}`
- 僅組建指定的測試目標:
`cargo {{[b|build]}} --test {{測試名稱}}`
+24
View File
@@ -0,0 +1,24 @@
# cargo check
> 檢查本地套件及其所有相依項是否有錯誤。
> 更多資訊:<https://doc.rust-lang.org/cargo/commands/cargo-check.html>。
- 檢查當前套件:
`cargo {{[c|check]}}`
- 檢查所有測試:
`cargo {{[c|check]}} --tests`
- 檢查 `tests/integration_test1.rs` 中的整合測試:
`cargo {{[c|check]}} --test {{integration_test1}}`
- 使用 `feature1``feature2` 功能檢查當前套件:
`cargo {{[c|check]}} {{[-F|--features]}} {{feature1,feature2}}`
- 禁用預設功能後檢測當前套件:
`cargo {{[c|check]}} --no-default-features`
+7 -7
View File
@@ -1,13 +1,13 @@
# cargo install
> 建並安裝一個 Rust 二進制文件
> 建並安裝一個 Rust 二進位檔案
> 更多資訊:<https://doc.rust-lang.org/cargo/commands/cargo-install.html>。
- 從 <https://crates.io> 安裝一個(版本是可選的,默認為最新版本):
- 從 <https://crates.io> 安裝一個套件(版本是可選的,默認為最新版本):
`cargo install {{包名}}@{{版本號}}`
`cargo install {{套件}}@{{版本號}}`
- 從指定的 Git 倉庫安裝一個
- 從指定的 Git 倉庫安裝一個套件
`cargo install --git {{倉庫 URL}}`
@@ -15,10 +15,10 @@
`cargo install --git {{倉庫 URL}} --{{branch|tag|rev}} {{branch_name|tag|commit_hash}}`
- 從本地目錄安裝一個
- 從本地目錄安裝一個套件
`cargo install --path {{路徑/至/目錄}}`
`cargo install --path {{路徑/至/套件}}`
- 列出所有已安裝的及其版本:
- 列出所有已安裝的套件及其版本:
`cargo install --list`
+2 -2
View File
@@ -1,10 +1,10 @@
# cargo
> 管理 Rust 專案及其模組依項(crates)。
> 管理 Rust 專案及其模組依項(crates)。
> 此命令也有關於其子命令的文件,例如:`build`.
> 更多資訊:<https://doc.rust-lang.org/stable/cargo/>。
- 搜尋套件:
- 搜尋套件crate
`cargo search {{搜尋關鍵詞}}`