diff --git a/po/ja.po b/po/ja.po index 4f700270..595ca60e 100644 --- a/po/ja.po +++ b/po/ja.po @@ -14228,13 +14228,16 @@ msgstr "" #: src/chromium.md msgid "Welcome to Rust in Chromium" -msgstr "" +msgstr "Chromium の Rust へようこそ" #: src/chromium.md msgid "" "Rust is supported for third-party libraries in Chromium, with first-party " "glue code to connect between Rust and existing Chromium C++ code." msgstr "" +"Rust は Chromium のサードパーティ ライブラリでサポートされています。Rust と既" +"存の Chromium C++ コードを接続するには、ファースト パーティのグルーコードを使" +"用します。" #: src/chromium.md msgid "" @@ -14243,6 +14246,9 @@ msgid "" "feel free to follow this recipe in your part of the codebase instead of the " "exact part we talk about." msgstr "" +"本日は、Rust で文字列を使って面白いことをしたいと思います。もし自分の担当部分" +"にUTF8 文字列を表示するコードがある場合は、ここで述べた部分ではなく、自分の" +"コードに対してこの手順を実行して構いません。" #: src/chromium/setup.md msgid "" @@ -14250,12 +14256,17 @@ msgid "" "flags is OK, so long as your code is relatively recent (commit position " "1223636 onwards, corresponding to November 2023):" msgstr "" +"Chromium をビルドして実行できることを確認します。コードが比較的最近のもの" +"(2023 年 11 月に対応するコミット位置 1223636 以降)であれば、任意のプラット" +"フォームとビルドフラグのセットで問題ありません。" #: src/chromium/setup.md msgid "" "(A component, debug build is recommended for quickest iteration time. This " "is the default!)" msgstr "" +"(反復処理の時間を最短にするには、コンポーネントのデバッグビルドをおすすめし" +"ます。これがデフォルトです)" #: src/chromium/setup.md msgid "" @@ -14263,14 +14274,17 @@ msgid "" "the-code/) if you aren't already at that point. Be warned: setting up to " "build Chromium takes time." msgstr "" +"まだ確認していない場合は、[Chromium のビルド方法](https://www.chromium.org/" +"developers/how-tos/get-the-code/) を確認してください。なお、Chromium をビルド" +"するためのセットアップには時間がかかります。" #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." -msgstr "" +msgstr "また、Visual Studio Code をインストールしておくことをおすすめします。" #: src/chromium/setup.md msgid "About the exercises" -msgstr "" +msgstr "演習について" #: src/chromium/setup.md msgid "" @@ -14279,6 +14293,9 @@ msgid "" "If you don't have time to complete a certain part, don't worry: you can " "catch up in the next slot." msgstr "" +"コースのこのパートには、相互に関連した一連の演習があります。コースの最後だけ" +"でなく、全体を通して演習を行います。特定のパートを完了する時間がない場合も、" +"後で追いつけばよいため心配はいりません。" #: src/chromium/cargo.md msgid "" @@ -14286,10 +14303,13 @@ msgid "" "crates.io/). Chromium is built using `gn` and `ninja` and a curated set of " "dependencies." msgstr "" +"Rust コミュニティでは通常、`cargo` と [crates.io](https://crates.io/) のライ" +"ブラリを使用します。Chromium は、`gn` と `ninja`、および厳選された依存関係の" +"セットを使用してビルドされています。" #: src/chromium/cargo.md msgid "When writing code in Rust, your choices are:" -msgstr "" +msgstr "Rust でコードを記述する際は、次の選択肢があります。" #: src/chromium/cargo.md msgid "" @@ -14297,6 +14317,9 @@ msgid "" "gni` (e.g. `rust_static_library` that we'll meet later). This uses " "Chromium's audited toolchain and crates." msgstr "" +"`//build/rust/*.gni` のテンプレート(例: 後で説明する `rust_static_library`)" +"を参考にして、`gn` と `ninja` を使用します。これには、Chromium の監査済みの" +"ツールチェーンとクレートが使用されます。" #: src/chromium/cargo.md msgid "" @@ -14304,12 +14327,17 @@ msgid "" "crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" "docs/rust.md#Using-cargo)" msgstr "" +"`cargo` を使用しますが、実際の利用を[Chromium の監査済みのツールチェーンとク" +"レートに制限します](https://chromium.googlesource.com/chromium/src/+/refs/" +"heads/main/docs/rust.md#Using-cargo)。" #: src/chromium/cargo.md msgid "" "Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " "downloaded from the internet](https://crates.io/)" msgstr "" +"`cargo` を使用し、[ツールチェーン](https://rustup.rs/) や [インターネットから" +"ダウンロードしたクレート](https://crates.io/) を信頼します。" #: src/chromium/cargo.md msgid "" @@ -14317,6 +14345,10 @@ msgid "" "code can be built into the Chromium browser. At the same time, Cargo is an " "important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" +"ここからは、`gn` と `ninja` に焦点を当てます。これらを使用することで、" +"Chromium ブラウザに Rust コードを組み込むことができます。それとは別に、Cargo " +"は Rust エコシステムの重要な部分であり、使いこなせるようになっているべきで" +"す。" #: src/chromium/cargo.md #, fuzzy @@ -14325,19 +14357,23 @@ msgstr "練習問題" #: src/chromium/cargo.md msgid "Split into small groups and:" -msgstr "" +msgstr "少人数のグループに分け、以下を行います。" #: src/chromium/cargo.md msgid "" "Brainstorm scenarios where `cargo` may offer an advantage and assess the " "risk profile of these scenarios." msgstr "" +"`cargo` がメリットをもたらす可能性のあるシナリオをブレインストーミングし、そ" +"れらのシナリオのリスク プロファイルを評価します。" #: src/chromium/cargo.md msgid "" "Discuss which tools, libraries, and groups of people need to be trusted when " "using `gn` and `ninja`, offline `cargo`, etc." msgstr "" +"`gn` や `ninja`、オフラインの `cargo` などを使用する際に、どのツール、ライブ" +"ラリ、人々を信頼しなければならないかについて話し合います。" #: src/chromium/cargo.md msgid "" @@ -14345,12 +14381,16 @@ msgid "" "exercise. Assuming folks taking the course are physically together, ask them " "to discuss in small groups of 3-4 people." msgstr "" +"受講者に、演習を完了する前にスピーカー ノートをのぞかないようお願いしてくださ" +"い。コースの受講者同士が地理的に集まっていると仮定して、3~4 人の少人数のグ" +"ループで話し合ってもらうようにお願いしてください。" #: src/chromium/cargo.md msgid "" "Notes/hints related to the first part of the exercise (\"scenarios where " "Cargo may offer an advantage\"):" msgstr "" +"演習の前半に関するメモとヒント(「Cargo がメリットをもたらすシナリオ」):" #: src/chromium/cargo.md msgid "" @@ -14360,18 +14400,28 @@ msgid "" "(`clap` for command-line parsing, `serde` for serializing/deserializing to/" "from various formats, `itertools` for working with iterators, etc.)." msgstr "" +"ツールの作成時や Chromium の一部のプロトタイピング時に、crates.io ライブラリ" +"の充実したエコシステムにアクセスできるのは素晴らしいことです。ほぼすべての事" +"柄についてクレートが用意されており、大概の場合はとても快適に使用できます(コ" +"マンドラインを解析するための `clap`、さまざまな形式との間でシリアル化または逆" +"シリアル化を行うための `serde`、イテレータを操作するための `itertools` な" +"ど)。" #: src/chromium/cargo.md msgid "" "`cargo` makes it easy to try a library (just add a single line to `Cargo." "toml` and start writing code)" msgstr "" +"`cargo` を使用すると、ライブラリを簡単に試すことができます(`Cargo.toml` に " +"1 行追加してコードの記述を開始するだけです)。" #: src/chromium/cargo.md msgid "" "It may be worth comparing how CPAN helped make `perl` a popular choice. Or " "comparing with `python` + `pip`." msgstr "" +"`perl` の普及に役立った CPAN や、`python` における `pip` と比較してみると良い" +"かもしれません。" #: src/chromium/cargo.md msgid "" @@ -14382,20 +14432,31 @@ msgid "" "streamlining and sharing security audits; `criterion` crate gives a " "streamlined way to run benchmarks)." msgstr "" +"主要な Rust ツール(ナイトリー、現在の安定版、古い安定版で動作する必要がある" +"クレートをテストするときに、別の `rustc` バージョンに切り替えるのに使用する " +"`rustup` など)だけでなく、サードパーティ ツールのエコシステム(Mozilla が提" +"供するセキュリティ監査の容易化と共有のため `cargo vet`、ベンチマークを容易に" +"実行する方法を提供する `criterion` クレートなど)により、開発エクスペリエンス" +"は非常に快適となっています。" #: src/chromium/cargo.md msgid "" "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" +"`cargo` を使用すると、`cargo install --locked cargo-vet` を介してツールを簡単" +"に追加できます。" #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" +"Chrome 拡張機能や VScode 拡張機能と比較してみるのも良いかもしれません。" #: src/chromium/cargo.md msgid "" "Broad, generic examples of projects where `cargo` may be the right choice:" msgstr "" +"`cargo` が適切な選択となるような、幅広い汎用的なプロジェクトの例を以下に示し" +"ます。" #: src/chromium/cargo.md msgid "" @@ -14405,6 +14466,10 @@ msgid "" "typesystem) and running faster (as a compiled, rather than interpreted " "language)." msgstr "" +"意外かもしれませんが、業界ではコマンドライン ツールの作成に使用する言語とし" +"て、Rust の人気が高まっています。ライブラリの幅とエルゴノミクスの点で Python " +"に匹敵しつつも、豊富な型システムのおかげで堅牢で、(インタプリタ言語ではなく" +"コンパイル言語なので)実行速度が高速です。" #: src/chromium/cargo.md msgid "" @@ -14413,26 +14478,34 @@ msgid "" "used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " "should probably use Cargo." msgstr "" +"Rust エコシステムに参加するには、Cargo などの標準の Rust ツールを使用する必要" +"があります。外部からコントリビューションを受け、Chromium 以外(Bazel や " +"Android / Soong のビルド環境など)での使用が推奨されるライブラリでは、Cargo " +"を使用することをおすすめします。" #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" -msgstr "" +msgstr "`cargo` ベースの Chromium 関連プロジェクトの例:" #: src/chromium/cargo.md msgid "" "`serde_json_lenient` (experimented with in other parts of Google which " "resulted in PRs with performance improvements)" msgstr "" +"`serde_json_lenient`(Google の他の部門でテストした結果、PR のパフォーマンス" +"が向上)" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" -msgstr "" +msgstr "`font-types` などのフォント化ライブラリ" #: src/chromium/cargo.md msgid "" "`gnrt` tool (we will meet it later in the course) which depends on `clap` " "for command-line parsing and on `toml` for configuration files." msgstr "" +"`gnrt` ツール(このコースの後半で取り上げます)は、コマンドラインの解析には " +"`clap` を使用し、構成ファイルには `toml` を使用します。" #: src/chromium/cargo.md msgid "" @@ -14440,6 +14513,9 @@ msgid "" "when building and bootstrapping Rust standard library when building Rust " "toolchain.)" msgstr "" +"免責条項: `cargo` を使用する唯一の理由は、Rust ツールチェーンのビルド中、" +"Rust 標準ライブラリのビルドとブートストラップを行う際に `gn` を使用できないこ" +"とでした。" #: src/chromium/cargo.md msgid "" @@ -14447,12 +14523,17 @@ msgid "" "third-party libraries downloaded from the internet, by `run_gnrt.py` asks " "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" +"`run_gnrt.py` は、Chromiumプロジェクト内の `cargo` と `rustc` のコピーを使用" +"します。`gnrt` はインターネットからダウンロードされたサードパーティ ライブラ" +"リに依存しており、`run_gnrt.py` で `Cargo.lock` を介して `--locked` コンテン" +"ツのみを許可することを `cargo` に要求します。" #: src/chromium/cargo.md msgid "" "Students may identify the following items as being implicitly or explicitly " "trusted:" msgstr "" +"以下のアイテムは、暗黙的または明示的に信頼されているとみなして構いません。" #: src/chromium/cargo.md msgid "" @@ -14460,40 +14541,51 @@ msgid "" "Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" +"LLVM ライブラリ、Clang コンパイラ、`rustc` ソース(GitHub から取得され、Rust " +"コンパイラ チームによるレビューを受けたもの)、ブートストラップ用にダウンロー" +"ドされたバイナリ Rust コンパイラに依存する `rustc`(Rust コンパイラ)" #: src/chromium/cargo.md msgid "" "`rustup` (it may be worth pointing out that `rustup` is developed under the " "umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" +"`rustup`(`rustup` は `rustc`と同じく https://github.com/rust-lang/ 組織の傘" +"下で開発されていることを説明すると良いかもしれません)" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." -msgstr "" +msgstr "`cargo`、`rustfmt` など" #: src/chromium/cargo.md msgid "" "Various internal infrastructure (bots that build `rustc`, system for " "distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" +"さまざまな内部インフラストラクチャ(`rustc` をビルドする bot、事前構築済みの" +"ツールチェーンを Chromium エンジニアに配布するためのシステムなど)" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." -msgstr "" +msgstr "`cargo audit` や `cargo vet` などの Cargo ツール" #: src/chromium/cargo.md msgid "" "Rust libraries vendored into `//third_party/rust` (audited by " "security@chromium.org)" msgstr "" +"`//third_party/rust` に取り込まれたRust ライブラリ(security@chromium.org が" +"監査)" #: src/chromium/cargo.md msgid "Other Rust libraries (some niche, some quite popular and commonly used)" msgstr "" +"その他の Rust ライブラリ(ニッチなものもあれば、非常に人気がありよく使用され" +"るものもあります)" #: src/chromium/policy.md msgid "Chromium Rust policy" -msgstr "" +msgstr "Chromium の Rust ポリシー" #: src/chromium/policy.md msgid "" @@ -14501,6 +14593,9 @@ msgid "" "approved by Chromium's [Area Tech Leads](https://source.chromium.org/" "chromium/chromium/src/+/main:ATL_OWNERS)." msgstr "" +"Chromium では、Chromium の [エリア テクニカル リード](https://source." +"chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) によって承認されている" +"まれなケースを除き、ファースト パーティでのRust使用はまだ許可されていません。" #: src/chromium/policy.md msgid "" @@ -14510,6 +14605,11 @@ msgid "" "circumstances, including if they're the best option for performance or for " "security." msgstr "" +"サードパーティ ライブラリに関する Chromium のポリシーについては、[こちら]" +"(https://chromium.googlesource.com/chromium/src/+/main/docs/" +"adding_to_third_party.md#rust) をご覧ください。Rust は、パフォーマンスやセ" +"キュリティを高めるうえで最適な選択肢である場合を含め、さまざまな状況でサード" +"パーティ ライブラリに使用することが許可されています。" #: src/chromium/policy.md msgid "" @@ -14517,6 +14617,8 @@ msgid "" "nearly all such libraries will require a small amount of first-party glue " "code." msgstr "" +"C / C++ API を直接公開する Rust ライブラリはほとんどないため、こうしたライブ" +"ラリのほぼすべてで、少量のファースト パーティ グルーコードが必要になります。" #: src/chromium/policy.md msgid "" @@ -14544,28 +14646,53 @@ msgid "" "-'\n" "```" msgstr "" +"```bob\n" +"\"C++\" Rust\n" +".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " +"-.\n" +": : : :\n" +": 既存の Chromium : : \"Chromium Rust\" \"既存の " +"Rust\" :\n" +": \"C++\" : : \"ラッパー\" クレー" +"ト :\n" +": +---------------+ : : +----------------+ +-------------" +"+ :\n" +": | | : : | | | " +"| :\n" +": | o-----+-+-----------+-+-> o-+----------+--> " +"| :\n" +": | | : 言語 : | | Crate | " +"| :\n" +": +---------------+ : 境界 : +----------------+ API +-------------" +"+ :\n" +": : : :\n" +"`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " +"-'\n" +"```" #: src/chromium/policy.md msgid "" "First-party Rust glue code for a particular third-party crate should " "normally be kept in `third_party/rust///wrapper`." msgstr "" +"特定のサードパーティ クレート用のファースト パーティ Rust グルーコードは通" +"常、`third_party/rust///wrapper` に置かれるべきです。" #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" -msgstr "" +msgstr "以上の理由から、本日のコースでは以下に焦点を当てます。" #: src/chromium/policy.md msgid "Bringing in third-party Rust libraries (\"crates\")" -msgstr "" +msgstr "サードパーティの Rust ライブラリ(「クレート」)を導入する。" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." -msgstr "" +msgstr "Chromium C++ からクレートを使用できるようにグルーコードを記述する。" #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." -msgstr "" +msgstr "このポリシーが変更された場合は、それに合わせてコースも変更されます。" #: src/chromium/build-rules.md #, fuzzy @@ -14578,15 +14705,19 @@ msgid "" "`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " "is no exception." msgstr "" +"Rust コードは通常、`cargo` を使用してビルドされます。Chromium は効率を高める" +"ために `gn` と `ninja`を使用してビルドされますが、その静的ルールによって最大" +"限の並列処理が可能になります。Rust も例外ではありません。" #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" -msgstr "" +msgstr "Chromium に Rust コードを追加する" #: src/chromium/build-rules.md msgid "" "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" msgstr "" +"Chromium の既存の `BUILD.gn` ファイルで、`rust_static_library` を宣言します。" #: src/chromium/build-rules.md msgid "" @@ -14599,12 +14730,22 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"import(\"//build/rust/rust_static_library.gni\")\n" +"\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [ \"lib.rs\" ]\n" +"}\n" +"```" #: src/chromium/build-rules.md msgid "" "You can also add `deps` on other Rust targets. Later we'll use this to " "depend upon third party code." msgstr "" +"他の Rust ターゲットに `deps` を追加することもできます。後でこれを使用して、" +"サードパーティのコードへの依存を設定します。" #: src/chromium/build-rules.md msgid "" @@ -14614,12 +14755,18 @@ msgid "" "list of all source files which `ninja` needs in order to determine when " "rebuilds are necessary." msgstr "" +"クレートルートとソースの完全なリストの両方を指定する必要があります。" +"`crate_root` は Rust コンパイラに渡されるファイルで、コンパイル単位のルート" +"ファイル(通常は `lib.rs`)を表します。`sources` はすべてのソースファイルの完" +"全なリストで、再ビルドが必要なタイミングを `ninja` が判断するために必要です。" #: src/chromium/build-rules.md msgid "" "(There's no such thing as a Rust `source_set`, because in Rust, an entire " "crate is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" +"(Rust ではクレート全体がコンパイル単位であるため、`source_set`と呼べるような" +"ものは存在しません。`static_library` が最小単位です)。" #: src/chromium/build-rules.md msgid "" @@ -14629,10 +14776,15 @@ msgid "" "this template provides support for CXX interop, Rust features, and unit " "tests, some of which we'll use later." msgstr "" +"受講者は、なぜ [Rust の静的ライブラリに対する gn の組み込みサポート](https://" +"gn.googlesource.com/gn/+/main/docs/reference.md#func_static_library) ではな" +"く、gn テンプレートを使用する必要があるのか疑問に思うかもしれません。その答え" +"は、このテンプレートが CXX 相互運用、Rustのfeatures、単体テストをサポートして" +"いるためです。その一部は後で使用します。" #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" -msgstr "" +msgstr "`unsafe` Rust コードの追加" #: src/chromium/build-rules/unsafe.md msgid "" @@ -14641,6 +14793,10 @@ msgid "" "the gn target. (Later in the course we'll see circumstances where this is " "necessary.)" msgstr "" +"安全でない Rust コードはデフォルトでは `rust_static_library` で禁止されてお" +"り、コンパイルできません。安全でない Rust コードが必要な場合は、gn ターゲット" +"に `allow_unsafe = true` を追加します(これが必要になる状況については、この" +"コースの後半で説明します)。" #: src/chromium/build-rules/unsafe.md msgid "" @@ -14657,10 +14813,24 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"import(\"//build/rust/rust_static_library.gni\")\n" +"\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [\n" +" \"lib.rs\",\n" +" \"hippopotamus.rs\"\n" +" ]\n" +" allow_unsafe = true\n" +"}\n" +"```" #: src/chromium/build-rules/depending.md msgid "Simply add the above target to the `deps` of some Chromium C++ target." msgstr "" +"上記のターゲットをいくつかの Chromium C++ ターゲットの `deps` に追加するだけ" +"です。" #: src/chromium/build-rules/depending.md msgid "" @@ -14678,62 +14848,94 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"import(\"//build/rust/rust_static_library.gni\")\n" +"\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [ \"lib.rs\" ]\n" +"}\n" +"\n" +"# または source_set、static_library など\n" +"component(\"preexisting_cpp\") {\n" +" deps = [ \":my_rust_lib\" ]\n" +"}\n" +"```" #: src/chromium/build-rules/vscode.md msgid "" "Types are elided in Rust code, which makes a good IDE even more useful than " "for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" +"Rust コードでは型が省略されているため、優れた IDE は C++ の場合よりもさらに有" +"用です。Visual Studio Code は Chromium の Rust で適切に機能します。Visual " +"Studio Code を使用するにあたり、以下の点を確認してください。" #: src/chromium/build-rules/vscode.md msgid "" "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " "Rust support" msgstr "" +"VSCode に、以前の形式の Rust サポートではなく、`rust-analyzer` 拡張機能がある" +"ことを確認" #: src/chromium/build-rules/vscode.md msgid "" "`gn gen out/Debug --export-rust-project` (or equivalent for your output " "directory)" msgstr "" +"`gn gen out/Debug --export-rust-project`(またはあなたのプロジェクトにおける" +"同様の出力ディレクトリ)" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" -msgstr "" +msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" "A demo of some of the code annotation and exploration features of rust-" "analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" +"IDE に懐疑的な受講者に対しては、rust-analyzer のコード アノテーションと探索機" +"能のデモを行うと良いかもしれません。" #: src/chromium/build-rules/vscode.md msgid "" "The following steps may help with the demo (but feel free to instead use a " "piece of Chromium-related Rust that you are most familiar with):" msgstr "" +"以下の手順に沿ってデモを行うことをおすすめします(代わりに自分が最も精通して" +"いる Chromium 関連の Rustコードを使用しても構いません)。" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" msgstr "" +"`components/qr_code_generator/qr_code_generator_ffi_glue.rs` を開きます。" #: src/chromium/build-rules/vscode.md msgid "" "Place the cursor over the `QrCode::new` call (around line 26) in " "\\`qr_code_generator_ffi_glue.rs" msgstr "" +"\\`qr_code_generator_ffi_glue.rs の `QrCode::new` 呼び出し(26 行目付近)に" +"カーソルを合わせます。" #: src/chromium/build-rules/vscode.md msgid "" "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " "K)." msgstr "" +"**show documentation** のデモを行います(一般的なバインディング: vscode = " +"ctrl ki、vim/CoC = K)。" #: src/chromium/build-rules/vscode.md msgid "" "Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " "(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" +"**go to definition** のデモを行います(一般的なバインディング: vscode = F12、" +"vim/CoC = g d)(これにより、`//third_party/rust/.../qr_code-.../src/lib.rs` " +"に移動します)。" #: src/chromium/build-rules/vscode.md msgid "" @@ -14741,12 +14943,17 @@ msgid "" "164; the outline is in the file explorer pane in vscode; typical vim/CoC " "bindings = space o)" msgstr "" +"**outline** のデモを行い、`QrCode::with_bits` メソッドに移動します(164 行目" +"付近。アウトラインは VSCode のファイル エクスプローラ ペインにあります。一般" +"的な vim/CoC バインディング = space o)。" #: src/chromium/build-rules/vscode.md msgid "" "Demo **type annotations** (there are quote a few nice examples in the " "`QrCode::with_bits` method)" msgstr "" +"**type annotations**のデモを行います(`QrCode::with_bits` メソッドにいくつか" +"の適切な例があります)。" #: src/chromium/build-rules/vscode.md msgid "" @@ -14754,17 +14961,21 @@ msgid "" "need to be rerun after editing `BUILD.gn` files (which we will do a few " "times throughout the exercises in this session)." msgstr "" +"`BUILD.gn` ファイルの編集後は `gn gen ... --export-rust-project` を再実行する" +"必要があることを説明してください(このセッションの演習全体で数回行います)。" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "Build rules exercise" -msgstr "ビルドのルール" +msgstr "ビルドのルールに関する演習" #: src/exercises/chromium/build-rules.md msgid "" "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " "containing:" msgstr "" +"Chromium のビルドで、以下を含む新しい Rust ターゲットを `//ui/base/BUILD.gn` " +"に追加します。" #: src/exercises/chromium/build-rules.md msgid "" @@ -14772,6 +14983,8 @@ msgid "" "by the Rust compiler, so you'll need to to allow unsafe code in your `gn` " "target." msgstr "" +"**重要**: ここでの `no_mangle` は Rust コンパイラでは安全でない型とみなされる" +"ため、`gn` ターゲットで安全でないコードを許可する必要があります。" #: src/exercises/chromium/build-rules.md msgid "" @@ -14779,6 +14992,9 @@ msgid "" "function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " "see how this can be automated by bindings generation tools):" msgstr "" +"この新しい Rust ターゲットを `//ui/base:base` の依存関係として追加します。こ" +"の関数を `ui/base/resource/resource_bundle.cc` の先頭で宣言します(後ほど、バ" +"インディング生成ツールでこれを自動化する方法を説明します)。" #: src/exercises/chromium/build-rules.md msgid "" @@ -14787,6 +15003,10 @@ msgid "" "and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " "times." msgstr "" +"この関数を `ui/base/resource/resource_bundle.cc` 内のどこかから呼び出します。" +"おすすめは`ResourceBundle::MaybeMangleLocalizedString` の先頭から呼び出すこと" +"です。Chromium をビルドして実行し、\"Hello from Rust!\" が何度も出力されてい" +"ることを確認します。" #: src/exercises/chromium/build-rules.md msgid "" @@ -14794,11 +15014,14 @@ msgid "" "in subsequent exercises. If you've succeeded, you will be able to use right-" "click \"Go to definition\" on `println!`." msgstr "" +"VSCode を使用している場合は、VSCode で適切に動作するように Rust を設定しま" +"す。これは、後続の演習で役立ちます。設定が完了したら、`println!` で \"Go to " +"definition\" を右クリックで利用できるようになります。" #: src/exercises/chromium/build-rules.md #: src/exercises/chromium/interoperability-with-cpp.md msgid "Where to find help" -msgstr "" +msgstr "参考情報" #: src/exercises/chromium/build-rules.md msgid "" @@ -14806,30 +15029,41 @@ msgid "" "source.chromium.org/chromium/chromium/src/+/main:build/rust/" "rust_static_library.gni;l=16)" msgstr "" +"[`rust_static_library` gn テンプレート](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16) で使用できるオプ" +"ション" #: src/exercises/chromium/build-rules.md msgid "" "Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" "abi.html#the-no_mangle-attribute)" msgstr "" +"[`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-" +"no_mangle-attribute) に関する情報" #: src/exercises/chromium/build-rules.md msgid "" "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." "extern.html)" msgstr "" +"[`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html) に関する" +"情報" #: src/exercises/chromium/build-rules.md msgid "" "Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" "gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" +"gn の [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/" +"reference.md#compilation-database) スイッチに関する情報" #: src/exercises/chromium/build-rules.md msgid "" "[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" "languages/rust)" msgstr "" +"[VSCode に rust-analyzer をインストールする方法](https://code.visualstudio." +"com/docs/languages/rust)" #: src/exercises/chromium/build-rules.md msgid "" @@ -14838,6 +15072,9 @@ msgid "" "call C ABI functions. Later in the course, we'll connect C++ directly to " "Rust." msgstr "" +"この例は、共通の相互運用言語である C に集約されているため、一般的ではありませ" +"ん。C++ と Rust はどちらも、C ABI 関数をネイティブに宣言して呼び出すことがで" +"きます。コースの後半で、C++ を Rust に直接接続します。" #: src/exercises/chromium/build-rules.md msgid "" @@ -14845,12 +15082,17 @@ msgid "" "Rust to generate two functions with the same name, and Rust can no longer " "guarantee that the right one is called." msgstr "" +"ここで `allow_unsafe = true` は必須です。`#[no_mangle]` により、Rust は同じ名" +"前の関数を2つ生成するようになり、Rust は正しい関数が呼び出されることを保証で" +"きなくなるためです。" #: src/exercises/chromium/build-rules.md msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." msgstr "" +"純粋な Rust 実行可能ファイルが必要な場合は、`rust_executable` gn テンプレート" +"を使用して行うこともできます。" #: src/chromium/testing.md msgid "" @@ -14858,6 +15100,9 @@ msgid "" "source file as the code being tested. This was covered [earlier](../testing." "md) in the course and looks like this:" msgstr "" +"Rust コミュニティは通常、テスト対象のコードと同じソースファイルに配置されたモ" +"ジュールで単体テストを作成します。これは本コースの [前の部分](../testing.md) " +"で説明しており、以下のようになります。" #: src/chromium/testing.md msgid "" @@ -14866,17 +15111,23 @@ msgid "" "and helps to avoid rebuilding `.rs` files a second time (in the `test` " "configuration)." msgstr "" +"Chromium では単体テストを別のソースファイルに配置しており、Rust でもこの方針" +"を継続します。これにより、テストが常に検出可能になり、2 度目に(`test` 構成" +"で)`.rs` ファイルを再ビルドする必要がなくなります。" #: src/chromium/testing.md msgid "" "This results in the following options for testing Rust code in Chromium:" msgstr "" +"その結果、Chromium で Rust コードをテストするための次の選択肢が提供されます。" #: src/chromium/testing.md msgid "" "Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" "rust`." msgstr "" +"ネイティブ Rust テスト(例: `#[test]`)。`//third_party/rust` 以外では推奨さ" +"れません。" #: src/chromium/testing.md msgid "" @@ -14884,6 +15135,9 @@ msgid "" "when Rust code is just a thin FFI layer and the existing unit tests provide " "sufficient coverage for the feature." msgstr "" +"C++ で作成され、FFI 呼び出しを介して Rust を実行する `gtest` テスト。Rust " +"コードが単なる薄いFFI レイヤであり、既存の単体テストで今後この機能が漏れなく" +"カバーされる場合には十分です。" #: src/chromium/testing.md msgid "" @@ -14891,6 +15145,9 @@ msgid "" "public API (using `pub mod for_testing { ... }` if needed). This is the " "subject of the next few slides." msgstr "" +"Rust で作成され、公開 API を介してテスト対象のクレートを使用する `gtest` テス" +"ト(必要に応じて `pub mod for_testing { ... }` を使用)。これについては、次の" +"数枚のスライドで説明します。" #: src/chromium/testing.md msgid "" @@ -14898,12 +15155,18 @@ msgid "" "exercised by Chromium bots. (Such testing is needed rarely --- only after " "adding or updating third-party crates.)" msgstr "" +"サードパーティ クレートのネイティブ Rust テストが最終的に Chromium bot によっ" +"て実行される必要があることを説明します(このようなテストが必要になることは" +"めったになく、サードパーティのクレートを追加または更新した後にのみ必要となり" +"ます)。" #: src/chromium/testing.md msgid "" "Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " "used:" msgstr "" +"C++ の`gtest` と Rust の`gtest` をどのような場合に使うべきか、いくつかの例を" +"使って説明するとよいでしょう。" #: src/chromium/testing.md msgid "" @@ -14912,6 +15175,10 @@ msgid "" "both the C++ and the Rust implementation (parameterizing the tests so they " "enable or disable Rust using a `ScopedFeatureList`)." msgstr "" +"QR には、ファースト パーティの Rust レイヤの機能はほとんどありません(単なる" +"シン FFI グルーです)。そのため、C++ と Rust の実装の両方をテストするには、既" +"存の C++ 単体テストを使用します(テストをパラメータ化し、`ScopedFeatureList` " +"を使用して Rust を有効化または無効化できるようになっています)。" #: src/chromium/testing.md msgid "" @@ -14920,24 +15187,35 @@ msgid "" "missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " "functionality may benefit from separate tests authored in Rust." msgstr "" +"仮定の、または開発中の PNG 統合では、`libpng` では提供されているのに、`png` " +"クレートでは欠落しているピクセル変換(RGBA => BGRA、ガンマ補正など)のメモリ" +"セーフな実装が必要となる場合があります。このような機能の開発においては、別途" +"Rustでテストを作成することが役立つ場合があります。" #: src/chromium/testing/rust-gtest-interop.md msgid "" "The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" "main/testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" +"[`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/" +"testing/rust_gtest_interop/README.md) ライブラリを使用すると、次のことができ" +"ます。" #: src/chromium/testing/rust-gtest-interop.md msgid "" "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " "attribute)" msgstr "" +"Rust 関数を `gtest` テストケースとして使用する(`#[gtest(...)]` 属性を使" +"用)。" #: src/chromium/testing/rust-gtest-interop.md msgid "" "Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " "panicking and not terminating the test when the assertion fails)." msgstr "" +"`expect_eq!` などのマクロを使用する(`assert_eq!`と似ていますが、アサーション" +"が失敗してもパニックせず、テストを終了しません)。" #: src/chromium/testing/rust-gtest-interop.md #, fuzzy @@ -14949,6 +15227,8 @@ msgid "" "The simplest way to build Rust `gtest` tests is to add them to an existing " "test binary that already contains tests authored in C++. For example:" msgstr "" +"Rust の `gtest` テストをビルドする最も簡単な方法は、C++ で作成されたテストが" +"すでに含まれている既存のテストバイナリに追加することです。次に例を示します。" #: src/chromium/testing/build-gn.md msgid "" @@ -14960,12 +15240,21 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"test(\"ui_base_unittests\") {\n" +" ...\n" +" sources += [ \"my_rust_lib_unittest.rs\" ]\n" +" deps += [ \":my_rust_lib\" ]\n" +"}\n" +"```" #: src/chromium/testing/build-gn.md msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" +"別途、`static_library` で Rust テストを作成することも可能ですが、サポート ラ" +"イブラリへの依存関係を手動で宣言する必要があります。" #: src/chromium/testing/build-gn.md msgid "" @@ -14987,6 +15276,23 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"rust_static_library(\"my_rust_lib_unittests\") {\n" +" testonly = true\n" +" is_gtest_unittests = true\n" +" crate_root = \"my_rust_lib_unittest.rs\"\n" +" sources = [ \"my_rust_lib_unittest.rs\" ]\n" +" deps = [\n" +" \":my_rust_lib\",\n" +" \"//testing/rust_gtest_interop\",\n" +" ]\n" +"}\n" +"\n" +"test(\"ui_base_unittests\") {\n" +" ...\n" +" deps += [ \":my_rust_lib_unittests\" ]\n" +"}\n" +"```" #: src/chromium/testing/chromium-import-macro.md msgid "" @@ -14997,14 +15303,20 @@ msgid "" "working with such an unwieldy name by using the `chromium::import!` macro " "from the automatically-imported `chromium` crate:" msgstr "" +"GN の `deps` に `:my_rust_lib` を追加した後も、`my_rust_lib_unittest.rs` か" +"ら `my_rust_lib` をインポートして使用する方法について学ぶ必要があります。" +"`my_rust_lib` には明示的な `crate_name` が指定されていないため、クレート名は" +"ターゲットのフルパスと名前に基づいて生成されます。幸い、自動的にインポートさ" +"れる `chromium` クレートから `chromium::import!` マクロを使用すれば、このよう" +"な扱いにくい名前の使用を回避できます。" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" -msgstr "" +msgstr "\"//ui/base:my_rust_lib\"" #: src/chromium/testing/chromium-import-macro.md msgid "Under the covers the macro expands to something similar to:" -msgstr "" +msgstr "内部で、マクロは次のように展開されます。" #: src/chromium/testing/chromium-import-macro.md msgid "" @@ -15013,6 +15325,10 @@ msgid "" "chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" +"詳しくは、`chromium::import` マクロの [ドキュメント コメント](https://source." +"chromium.org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" +"chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" +"third_party&ss=chromium%2Fchromium%2Fsrc) をご覧ください。" #: src/chromium/testing/chromium-import-macro.md msgid "" @@ -15022,6 +15338,11 @@ msgid "" "crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " "covered in a later section) use short crate names." msgstr "" +"`rust_static_library` は、`crate_name` プロパティによる明示的な名前の指定をサ" +"ポートしていますが、クレート名はグローバルに一意である必要があるため、これは" +"推奨されません。crates.io はクレート名の一意性を保証しているため、" +"`cargo_crate` GN ターゲット(後述の `gnrt` ツールで生成)は短いクレート名を使" +"用します。" #: src/exercises/chromium/testing.md #, fuzzy @@ -15030,11 +15351,11 @@ msgstr "練習問題" #: src/exercises/chromium/testing.md msgid "Time for another exercise!" -msgstr "" +msgstr "新たな演習の時間です!" #: src/exercises/chromium/testing.md msgid "In your Chromium build:" -msgstr "" +msgstr "Chromium ビルドで以下を行ってください。" #: src/exercises/chromium/testing.md msgid "" @@ -15042,18 +15363,22 @@ msgid "" "two integers received as arguments, computing the nth Fibonacci number, " "summing integers in a slice, etc." msgstr "" +"`hello_from_rust` の横にテスト可能な関数を追加します。たとえば、引数として受" +"け取った 2 つの整数を追加する、n 番目のフィボナッチ数を計算する、スライス内の" +"整数を合計する、などが考えられます。" #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." msgstr "" +"新しい関数のテストを含む別個の `..._unittest.rs` ファイルを追加します。" #: src/exercises/chromium/testing.md msgid "Add the new tests to `BUILD.gn`." -msgstr "" +msgstr "新しいテストを `BUILD.gn` に追加します。" #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." -msgstr "" +msgstr "テストをビルドして実行し、新しいテストが機能することを確認します。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15061,6 +15386,9 @@ msgid "" "tools being developed all the time. At the moment, Chromium uses a tool " "called CXX." msgstr "" +"Rust コミュニティには C++ と Rust の相互運用のためのオプションが複数用意され" +"ており、絶えず新しいツールが開発されています。現在のところ、Chromium では " +"CXX というツールを使用しています。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15068,12 +15396,16 @@ msgid "" "language (which looks a lot like Rust) and then CXX tools generate " "declarations for functions and types in both Rust and C++." msgstr "" +"言語境界全体をインターフェース定義言語(Rust によく似ています)で記述すると、" +"CXX ツールが Rust と C++ の両方で関数と型の宣言を生成します。" #: src/chromium/interoperability-with-cpp.md msgid "" "See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " "using this." msgstr "" +"CXX の詳細な使用例については、[CXX チュートリアル](https://cxx.rs/tutorial." +"html) をご覧ください。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15081,6 +15413,8 @@ msgid "" "the same as you previously did. Point out that automating the process has " "the following benefits:" msgstr "" +"図を見ながら話しましょう。裏で行われる処理は以前とまったく同じであり、このプ" +"ロセスを自動化すると次のようなメリットがあることを説明します。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15089,6 +15423,10 @@ msgid "" "definitions, but with out-of-sync manual bindings you'd get Undefined " "Behavior)" msgstr "" +"このツールは、C++ 側と Rust 側が一致することを保証します(たとえば、`#[cxx::" +"bridge]` が実際の C++ または Rust の定義と一致しない場合、コンパイル エラーが" +"発生しますが、同期されていない手動バインディングを使用すると、未定義の動作が" +"発生します)。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15097,10 +15435,14 @@ msgid "" "methods; manual bindings would require authoring such top-level, free " "functions manually)" msgstr "" +"このツールは、C 以外の機能に対する FFI サンク(小さな C-ABI 互換のフリー関" +"数)の生成を自動化します(Rust または C++ メソッドへの FFI 呼び出しの有効化な" +"ど。手動バインディングでは、このようなトップレベルのフリー関数を手動で作成す" +"る必要があります)。" #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" -msgstr "" +msgstr "ツールとライブラリは、次のような一連の主要な型を処理できます。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15110,6 +15452,10 @@ msgid "" "pointer and length - this is error-prone given that each language represents " "empty slices slightly differently)" msgstr "" +"`&[T]` は、特定の ABI やメモリ レイアウトを保証するものではありませんが、FFI " +"の境界を超えて渡すことができます。手動バインディングでは、`std::span` / " +"`&[T]` を手動で分離し、ポインタと長さから再構築する必要があります。言語ごとに" +"空のスライスの表現方法が若干異なるため、エラーが発生しやすくなります。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15118,6 +15464,10 @@ msgid "" "compatible raw pointers, which would increase lifetime and memory-safety " "risks." msgstr "" +"`std::unique_ptr`、`std::shared_ptr`、`Box` などのスマート ポインタは、" +"ネイティブにサポートされています。手動バインディングでは、C-ABI 互換の未加工" +"ポインタを渡す必要があるため、ライフタイムとメモリ安全性に関するリスクが高ま" +"ります。" #: src/chromium/interoperability-with-cpp.md msgid "" @@ -15126,24 +15476,29 @@ msgid "" "build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" "terminate a string)." msgstr "" +"`rust::String` 型と `CxxString` 型は、言語間の文字列表現の違いを理解し、維持" +"します(たとえば、`rust::String::lossy` は、非 UTF8 の入力から Rust 文字列を" +"作成できます。また、`rust::String::c_str` は文字列を NUL 終端できます)。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" +"CXX では、C++ と Rust の境界全体を `.rs` ソースコード内の `cxx::bridge` モ" +"ジュールで宣言する必要があります。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" -msgstr "" +msgstr "\"example/include/blobstore.h\"" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "// Definitions of Rust types and functions go here\n" -msgstr "" +msgstr "// Rust の型と関数の定義をここに記述します。\n" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Point out:" -msgstr "" +msgstr "以下を説明します。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" @@ -15152,23 +15507,26 @@ msgid "" "bit more sophisticated - though this does still result in a `mod` called " "`ffi` in your code." msgstr "" +"これは通常の Rust `mod` のように見えますが、`#[cxx::bridge]` プロシージャル " +"マクロはこれに対して複雑な処理を行います。生成されるコードはもっと洗練されて" +"いますが、それでもコードには `ffi` という `mod` が作成されます。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" -msgstr "" +msgstr "Rust での C++ の `std::unique_ptr` のネイティブ サポート" #: src/chromium/interoperability-with-cpp/example-bindings.md #, fuzzy msgid "Native support for Rust slices in C++" -msgstr "組み込みのテストサポート。" +msgstr "Rust での C++ の `std::unique_ptr` のネイティブ サポート" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Calls from C++ to Rust, and Rust types (in the top part)" -msgstr "" +msgstr "C++ から Rust および Rust の型への呼び出し(上部)" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Calls from Rust to C++, and C++ types (in the bottom part)" -msgstr "" +msgstr "Rust から C++ および C++ の型への呼び出し(下部)" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" @@ -15177,34 +15535,42 @@ msgid "" "simply `#include`d in the generated C++ code for the benefit of C++ " "compilers." msgstr "" +"**よくある誤解**: Rust で C++ ヘッダーが解析されているように見えますが、これ" +"は誤解です。このヘッダーは Rust では解釈されず、C++ コンパイラのために生成さ" +"れた C++ コードに `#include` されているだけです。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "By far the most useful page when using CXX is the [type reference](https://" "cxx.rs/bindings.html)." msgstr "" +"CXX を使用するときに最も役立つページは、[型リファレンス](https://cxx.rs/" +"bindings.html) です。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" -msgstr "" +msgstr "CXX は基本的に、次のようなケースに適しています。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "Your Rust-C++ interface is sufficiently simple that you can declare all of " "it." -msgstr "" +msgstr "Rust-C++ インターフェースが十分にシンプルで、すべてを宣言できる場合。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "You're using only the types natively supported by CXX already, for example " "`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" +"すでに CXX でネイティブにサポートされている型のみを使用している場合(例: " +"`std::unique_ptr`、`std::string`、`&[u8]`)。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "It has many limitations --- for example lack of support for Rust's `Option` " "type." msgstr "" +"Rust の `Option` 型がサポートされていないなど、CXX には多くの制限があります。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" @@ -15214,47 +15580,60 @@ msgid "" "draft the CXX bindings for the language boundary to see if it appears simple " "enough." msgstr "" +"こうした制限により、Chromium では 任意の Rust と C++ の相互運用は行われず、" +"Rustの使用は十分に独立したコードに限定されています。Chromium での Rust のユー" +"スケースを検討する際は、まず、言語境界の CXX バインディングの下書きを作成し" +"て、シンプルに見えるかどうかを確認することをおすすめします。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "You should also discuss some of the other sticky points with CXX, for " "example:" msgstr "" +"また、CXX のその他の厄介な点を説明する必要があります。次に例を示します。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "Its error handling is based around C++ exceptions (given on the next slide)" -msgstr "" +msgstr "エラー処理が C++ 例外に基づいて行われる(次のスライドを参照)。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "Function pointers are awkward to use." -msgstr "" +msgstr "関数ポインタが使いにくい。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " "on C++ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" +"CXX の [`Result` のサポート](https://cxx.rs/binding/result.html) は、C+" +"+ 例外に依存しているため、Chromium では使用できません。以下の代替手段がありま" +"す。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" -msgstr "" +msgstr "`Result` の `T` の部分:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " "be passed across the FFI boundary - for example `T` has to be:" msgstr "" +"out パラメータを介して返すことができます(例: `&mut T`)。そのためには、`T` " +"を FFI の境界を越えて渡せる必要があります。たとえば、`T` には以下を指定する必" +"要があります。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" -msgstr "" +msgstr "プリミティブ型(`u32`、`usize` など)" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" +"(`Box` とは異なり)適切なデフォルト値を持つ`cxx` でネイティブにサポートされ" +"ている型(`UniquePtr` など)。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" @@ -15262,22 +15641,29 @@ msgid "" "when `T` is a Rust type, which cannot be passed across the FFI boundary, and " "cannot be stored in `UniquePtr`." msgstr "" +"Rust 側で保持し、参照を介して公開できます。これは、`T` が Rust 型の場合に必要" +"になることがあります。Rust 型は FFI の境界を超えて渡すことができず、" +"`UniquePtr` に格納することもできません。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" -msgstr "" +msgstr "`Result` の `E` の部分:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Returned as a boolean (e.g. `true` representing success, and `false` " "representing failure)" msgstr "" +"ブール値として返すことができます(たとえば、`true` は成功、`false` は失敗を表" +"します)。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Preserving error details is in theory possible, but so far hasn't been " "needed in practice." msgstr "" +"理論上はエラーの詳細を保持できますが、これまでは実際に必要になることはありま" +"せんでした。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md #, fuzzy @@ -15292,10 +15678,14 @@ msgid "" "used to communicate success vs failure, and where the successful result can " "be passed across the FFI boundary:" msgstr "" +"QR コード生成ツールは、ブール値が成功または失敗を伝達し、成功の結果を FFI の" +"境界を超えて受け渡すことができる [一例](https://source.chromium.org/chromium/" +"chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." +"rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) です。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" -msgstr "" +msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" @@ -15304,6 +15694,9 @@ msgid "" "admittedly it is a bit redundant - this is the square root of the size of " "the vector)." msgstr "" +"受講者は `out_qr_size` 出力のセマンティクスに関心を持っている可能性がありま" +"す。これはベクターのサイズではなく、QR コードのサイズです(つまり、この情報は" +"冗長であり、ベクターのサイズの平方根に相当します)。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" @@ -15312,6 +15705,9 @@ msgid "" "points to uninitialized memory results in Undefined Behavior (unlike in C++, " "when only the act of dereferencing such memory results in UB)." msgstr "" +"Rust 関数を呼び出す前に `out_qr_size` を初期化することの重要性を説明しましょ" +"う。初期化されていないメモリを指す Rust 参照を作成すると、未定義の動作となり" +"ます(そのようなメモリを逆参照する操作のみが UB になるC++ とは異なります)。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" @@ -15319,6 +15715,10 @@ msgid "" "references to C++ data: the answer is that C++ data can’t be moved around " "like Rust data, because it may contain self-referential pointers." msgstr "" +"`Pin` について受講者から尋ねられた場合は、CXX が C++ データへの可変参照のため" +"に `Pin` を必要とする理由を説明します。つまり、C++ のデータには自己参照ポイン" +"タが含まれている可能性があるため、Rust のデータのように移動することができませ" +"ん。" #: src/chromium/interoperability-with-cpp/error-handling-png.md #, fuzzy @@ -15330,24 +15730,28 @@ msgid "" "A prototype of a PNG decoder illustrates what can be done when the " "successful result cannot be passed across the FFI boundary:" msgstr "" +"PNG デコーダのプロトタイプは、成功した結果を FFI の境界を越えて渡せない場合に" +"何ができるかを示しています。" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" -msgstr "" +msgstr "\"gfx::rust_bindings\"" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "/// This returns an FFI-friendly equivalent of `Result,\n" " /// ()>`.\n" msgstr "" +"/// これは `Result,()>` と同等の FFI 対応の結果を\n" +" /// 返します。\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" -msgstr "" +msgstr "/// `crate::png::ResultOfPngReader` 型の C++ バインディング\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "/// C++ bindings for the `crate::png::PngReader` type.\n" -msgstr "" +msgstr "/// `crate::png::PngReader` 型の C++ バインディング\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" @@ -15356,6 +15760,10 @@ msgid "" "can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " "to store Rust objects by value." msgstr "" +"`PngReader` と `ResultOfPngReader`は Rust 型です。これらの型のオブジェクト" +"は、`Box` を介さずに FFI 境界を越えることはできません。CXX では Rust オブ" +"ジェクトを値で格納できないため、`out_parameter: &mut PngReader` と書くことは" +"できません。" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" @@ -15366,10 +15774,14 @@ msgid "" "appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " "`as_mut`)." msgstr "" +"この例は、CXX が任意のジェネリクスやテンプレートをサポートしていなくても、手" +"動で非ジェネリック型に特化 / 単相化することで、FFI 境界を越えて渡せることを示" +"しています。この例では、`ResultOfPngReader` は`Result` の適切なメソッド" +"(`is_err`、`unwrap`、`as_mut` など)に渡される非ジェネリック型です。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" -msgstr "" +msgstr "Chromium で cxx を使用する" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -15377,6 +15789,8 @@ msgid "" "node where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" +"Chromium では、Rust を使用するリーフノードごとに独立した `#[cxx::bridge] " +"mod` を定義します。通常は、`rust_static_library` ごとに 1 つずつになります。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -15386,20 +15800,28 @@ msgid "" "allow_unsafe = true\n" "```" msgstr "" +"```gn\n" +"cxx_bindings = [ \"my_rust_file.rs\" ]\n" +" # すべてのソースファイルではなく、#[cxx::bridge] を含むファイルのリスト\n" +"allow_unsafe = true\n" +"```" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "to your existing `rust_static_library` target alongside `crate_root` and " "`sources`." msgstr "" +"上記のコードを、`crate_root` や `sources`と並んで、既存の " +"`rust_static_library` ターゲットに追加するだけです。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "C++ headers will be generated at a sensible location, so you can just" msgstr "" +"C++ ヘッダーは適切な場所で生成されるため、次のようにインクルードできます。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "\"ui/base/my_rust_file.rs.h\"" -msgstr "" +msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -15408,10 +15830,16 @@ msgid "" "source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" "l=21)." msgstr "" +"`//base` には、Chromium C++ 型から CXX Rust 型(およびその逆方向)への変換を" +"行うためのユーティリティ関数がいくつかあります(例: [`SpanToRustSlice`]" +"(https://source.chromium.org/chromium/chromium/src/+/main:base/containers/" +"span_rust.h;l=21))。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" msgstr "" +"受講者から、`allow_unsafe = true` がなぜここでも必要なのかを尋ねられる可能性" +"があります。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -15423,6 +15851,13 @@ msgid "" "writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " "binary can cause unexpected behavior from Rust's perspective." msgstr "" +"大まかに答えると、C/C++ コードは通常の Rust 標準では「安全」ではありません。" +"Rust から C/C++ に行ったり来たりすると、メモリに対して任意の処理が行われ、" +"Rust 独自のデータ レイアウトの安全性が損なわれる可能性があります。C/C++ の相" +"互運用で `unsafe` キーワードが多すぎると、`unsafe`に対する注目度が薄れるの" +"で、これには [賛否両論があります](https://steveklabnik.com/writing/the-cxx-" +"debate)。ただし厳密には、外部コードを Rust バイナリに取り込むと、Rust の観点" +"からは想定していない動作が発生する可能性があります。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" @@ -15431,15 +15866,18 @@ msgid "" "`unsafe` and `extern \"C\"` functions just like we did manually in the " "previous section." msgstr "" +"具体的な答えは、[このページ](../interoperability-with-cpp.md) の上部の図にあ" +"ります。裏では、CXX は Rust の `unsafe` 関数と `extern \"C\"` 関数を生成しま" +"す。これは前のセクションで手動で行ったのとまったく同じです。" #: src/exercises/chromium/interoperability-with-cpp.md #, fuzzy msgid "Exercise: Interoperability with C++" -msgstr "相互運用性" +msgstr "演習: C++との相互運用性" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Part one" -msgstr "" +msgstr "パート 1" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -15447,50 +15885,61 @@ msgid "" "specifies a single function, to be called from C++, called " "`hello_from_rust`, taking no parameters and returning no value." msgstr "" +"先ほど作成した Rust ファイルに、C++ から呼び出す単一の関数を示す `#[cxx::" +"bridge]` を追加します。これは `hello_from_rust` という関数で、パラメータを受" +"け取らず、値も返しません。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " "`#[no_mangle]`. This is now just a standard Rust function." msgstr "" +"前の `hello_from_rust` 関数を変更して `extern \"C\"` と `#[no_mangle]` を削除" +"します。これで標準の Rust 関数になります。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Modify your `gn` target to build these bindings." -msgstr "" +msgstr "`gn` ターゲットを変更して、これらのバインディングをビルドします。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "In your C++ code, remove the forward-declaration of `hello_from_rust`. " "Instead, include the generated header file." msgstr "" +"C++ コードで、`hello_from_rust` の前方宣言を削除し、代わりに生成されたヘッ" +"ダー ファイルをインクルードします。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" -msgstr "" +msgstr "ビルドして実行します。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Part two" -msgstr "" +msgstr "パート 2" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "It's a good idea to play with CXX a little. It helps you think about how " "flexible Rust in Chromium actually is." msgstr "" +"CXX を少し使ってみて、Chromium における Rust の柔軟性について理解を深めましょ" +"う。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" -msgstr "" +msgstr "以下を試してください。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Call back into C++ from Rust. You will need:" -msgstr "" +msgstr "Rust から C++ を呼び出します。これには以下が必要です。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" +"`cxx::bridge` から `include!` できる追加のヘッダー ファイル。その新しいヘッ" +"ダー ファイルで C++ 関数を宣言する必要があります。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -15498,56 +15947,69 @@ msgid "" "`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" "extern-c++.html#functions-and-member-functions)." msgstr "" +"このような関数を呼び出す `unsafe` ブロック。または [こちら](https://cxx.rs/" +"extern-c++.html#functions-and-member-functions) に記載されているとおり、" +"`#[cxx::bridge]` 内で `unsafe` キーワードを指定する必要があります。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." "h\"`" msgstr "" +"`#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"` も必要になるかもし" +"れません。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." -msgstr "" +msgstr "C++ から Rust に C++ 文字列を渡します。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a reference to a C++ object into Rust." -msgstr "" +msgstr "C++ オブジェクトへの参照を Rust に渡します。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" +"意図的に`#[cxx::bridge]`と一致しないようにRust 関数のシグネチャを変更し、表示" +"されるエラーに慣れるようにします。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" +"意図的に`#[cxx::bridge]`と一致しないようにC++ 関数のシグネチャを変更し、表示" +"されるエラーに慣れるようにします。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " "own some C++ object." msgstr "" +"なんらかの型の `std::unique_ptr` を C++ から Rust に渡して、Rust がいくつか" +"の C++ オブジェクトを所有できるようにします。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " "need a `Box`)." msgstr "" +"Rust オブジェクトを作成して C++ に渡して、C++ がそれを所有できるようにします" +"(ヒント: `Box` が必要です)。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." -msgstr "" +msgstr "C++ 型でいくつかのメソッドを宣言し、Rust から呼び出します。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a Rust type. Call them from C++." -msgstr "" +msgstr "Rust 型に対していくつかのメソッドを宣言し、C++ から呼び出します。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Part three" -msgstr "" +msgstr "パート 3" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -15555,20 +16017,25 @@ msgid "" "couple of use-cases for Rust in Chromium where the interface would be " "sufficiently simple. Sketch how you might define that interface." msgstr "" +"CXX の相互運用性の長所と制限事項について理解したところで、インターフェースが" +"非常にシンプルな、Chromium での Rust のユースケースをいくつか考えてみましょ" +"う。このインターフェースをどのように定義すればよいか考えてみましょう。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" -msgstr "" +msgstr "[`cxx` バインディング リファレンス](https://cxx.rs/bindings.html)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "The [`rust_static_library` gn template](https://source.chromium.org/chromium/" "chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" msgstr "" +"[`rust_static_library` gn テンプレート](https://source.chromium.org/chromium/" +"chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" -msgstr "" +msgstr "次のような質問が寄せられる可能性があります。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -15576,6 +16043,8 @@ msgid "" "and Y are both function types. This is because your C++ function doesn't " "quite match the declaration in your `cxx::bridge`." msgstr "" +"X と Y の両方が関数型である場合に、型 X の変数を型 Y で初期化すると問題が発生" +"します。これは、C++ 関数が `cxx::bridge` 内の宣言と完全に一致しないためです。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" @@ -15584,6 +16053,10 @@ msgid "" "sized. For CXX trivial types yes, it's _possible_ to cause UB, although " "CXX's design makes it quite difficult to craft such an example." msgstr "" +"C++ 参照を Rust 参照に自由に変換できるようですが、UB のリスクはないでしょう" +"か?CXX の不透明型の場合、サイズがゼロであるため、そのリスクはありません。" +"CXX のトリビアル型では UB が発生する可能性がありますが、CXX の設計上、そのよ" +"うな例を作成するのは非常に困難です。" #: src/chromium/adding-third-party-crates.md msgid "" @@ -15591,6 +16064,9 @@ msgid "" "crates.io). It's _very easy_ for Rust crates to depend upon one another. So " "they do!" msgstr "" +"Rust ライブラリは「クレート」と呼ばれ、[crates.io](https://crates.io) にあり" +"ます。Rust クレートを互いに依存させるのは非常に簡単であり、実際にそのように" +"なっています" #: src/chromium/adding-third-party-crates.md #, fuzzy @@ -15600,76 +16076,80 @@ msgstr "ライブラリ" #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "Rust crate" -msgstr "便利クレート" +msgstr "Rustクレート" #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "Build system" -msgstr "ビルドのルール" +msgstr "ビルドシステム" #: src/chromium/adding-third-party-crates.md msgid "Lots" -msgstr "" +msgstr "多数" #: src/chromium/adding-third-party-crates.md msgid "Consistent: `Cargo.toml`" -msgstr "" +msgstr "一貫して `Cargo.toml`" #: src/chromium/adding-third-party-crates.md msgid "Typical library size" -msgstr "" +msgstr "一般的なライブラリ サイズ" #: src/chromium/adding-third-party-crates.md msgid "Large-ish" -msgstr "" +msgstr "やや大" #: src/chromium/adding-third-party-crates.md msgid "Small" -msgstr "" +msgstr "小" #: src/chromium/adding-third-party-crates.md msgid "Transitive dependencies" -msgstr "" +msgstr "推移的依存関係" #: src/chromium/adding-third-party-crates.md msgid "Few" -msgstr "" +msgstr "少" #: src/chromium/adding-third-party-crates.md msgid "For a Chromium engineer, this has pros and cons:" -msgstr "" +msgstr "Chromium のエンジニアにとって、クレートには長所と短所があります。" #: src/chromium/adding-third-party-crates.md msgid "" "All crates use a common build system so we can automate their inclusion into " "Chromium..." msgstr "" +"すべてのクレートが共通のビルドシステムを使用しているため、Chromium への取り込" +"みを自動化できます。" #: src/chromium/adding-third-party-crates.md msgid "" "... but, crates typically have transitive dependencies, so you will likely " "have to bring in multiple libraries." msgstr "" +"しかし、クレートには通常、推移的依存関係があるため、複数のライブラリを取り込" +"むことが必要になる可能性があります。" #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" -msgstr "" +msgstr "議論する内容は次のとおりです。" #: src/chromium/adding-third-party-crates.md msgid "How to put a crate in the Chromium source code tree" -msgstr "" +msgstr "Chromium ソースコード ツリーにクレートを配置する方法" #: src/chromium/adding-third-party-crates.md msgid "How to make `gn` build rules for it" -msgstr "" +msgstr "クレート用の `gn` ビルドルールを作成する方法" #: src/chromium/adding-third-party-crates.md msgid "How to audit its source code for sufficient safety." -msgstr "" +msgstr "クレートのソースコードの十分な安全性を監査する方法。" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "Configuring the `Cargo.toml` file to add crates" -msgstr "" +msgstr " `Cargo.toml` ファイルによりクレートを追加する方法" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -15678,6 +16158,9 @@ msgid "" "org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." "toml):" msgstr "" +"Chromium には、一元管理される直接的なクレート依存関係が 1 セットあります。こ" +"れらは単一の [`Cargo.toml`](https://source.chromium.org/chromium/chromium/" +"src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) で管理されます。" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -15689,6 +16172,13 @@ msgid "" "# lots more...\n" "```" msgstr "" +"```toml\n" +"[dependencies]\n" +"bitflags = \"1\"\n" +"cfg-if = \"1\"\n" +"cxx = \"1\"\n" +"# lots more...\n" +"```" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" @@ -15697,12 +16187,17 @@ msgid "" "dependencies.html) --- most commonly, you'll want to specify the `features` " "that you wish to enable in the crate." msgstr "" +"他の `Cargo.toml` と同様に、[依存関係の詳細](https://doc.rust-lang.org/cargo/" +"reference/specifying-dependencies.html) を指定できます。通常は、クレートで有" +"効にする `features` を指定します。" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "When adding a crate to Chromium, you'll often need to provide some extra " "information in an additional file, `gnrt_config.toml`, which we'll meet next." msgstr "" +"Chromium にクレートを追加する際は、多くの場合、 `gnrt_config.toml`という追加" +"ファイルに情報を指定する必要があります。これについては後で説明します。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" @@ -15710,39 +16205,51 @@ msgid "" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." "toml). This contains Chromium-specific extensions to crate handling." msgstr "" +"`Cargo.toml` のほかに、[`gnrt_config.toml`](https://source.chromium.org/" +"chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." +"toml) があります。これには、クレートを扱うための Chromium 固有の拡張機能が含" +"まれています。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "If you add a new crate, you should specify at least the `group`. This is one " "of:" msgstr "" +"新しいクレートを追加する場合は、少なくとも次のいずれかの `group` を指定する必" +"要があります。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "For instance," -msgstr "" +msgstr "次に例を示します。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Depending on the crate source code layout, you may also need to use this " "file to specify where its `LICENSE` file(s) can be found." msgstr "" +"クレートのソースコードのレイアウトによっては、このファイルを使用して " +"`LICENSE` ファイルを見つける場所も指定する必要があります。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Later, we'll see some other things you will need to configure in this file " "to resolve problems." msgstr "" +"後ほど、いくつかの問題を解決するためにこのファイルに指定する必要がある設定に" +"ついて取り扱います。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "A tool called `gnrt` knows how to download crates and how to generate `BUILD." "gn` rules." msgstr "" +"`gnrt` というツールは、クレートのダウンロード方法と `BUILD.gn` ルールの生成方" +"法を把握しています。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" -msgstr "" +msgstr "まず、必要なクレートを次のようにダウンロードします。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" @@ -15751,25 +16258,30 @@ msgid "" "`crates.io`. See [the earlier section](../cargo.md) discussing this security " "decision." msgstr "" +"`gnrt` ツールは Chromium のソースコードの一部ですが、このコマンドを実行する" +"と、`crates.io` から依存関係をダウンロードして実行します。これに関するセキュ" +"リティ上の決定については、[前のセクション](../cargo.md) をご覧ください。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" -msgstr "" +msgstr "この `vendor` コマンドにより、以下がダウンロードされる場合があります。" #: src/chromium/adding-third-party-crates/downloading-crates.md #, fuzzy msgid "Your crate" -msgstr "便利クレート" +msgstr "あなたのクレート" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "Direct and transitive dependencies" -msgstr "" +msgstr "直接的および推移的依存関係" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "New versions of other crates, as required by `cargo` to resolve the complete " "set of crates required by Chromium." msgstr "" +" `cargo` によって指示される、Chromium で必要となるクレートの完全セットを得る" +"ための他のクレートの新しいバージョン。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" @@ -15777,31 +16289,39 @@ msgid "" "chromium_crates_io/patches`. These will be reapplied automatically, but if " "patching fails you may need to take manual action." msgstr "" +"Chromium では、一部のクレートに対するパッチが `//third_party/rust/" +"chromium_crates_io/patches` に保存されています。これらは自動的に再適用されま" +"すが、パッチ適用が失敗した場合は、手動による解決が必要になる場合があります。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" +"クレートをダウンロードしたら、以下のように `BUILD.gn` ファイルを作成します。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Now run `git status`. You should find:" -msgstr "" +msgstr "`git status` を実行し、以下を確認します。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "At least one new crate source code in `third_party/rust/chromium_crates_io/" "vendor`" msgstr "" +"`third_party/rust/chromium_crates_io/vendor` に 1 つ以上の新しいクレート ソー" +"スコードがあること" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "At least one new `BUILD.gn` in `third_party/rust//v`" msgstr "" +"`third_party/rust//v` に 1 つ以上の新しい " +"`BUILD.gn` があること" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "An appropriate `README.chromium`" -msgstr "" +msgstr "適切な `README.chromium` があること" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md #, fuzzy @@ -15815,7 +16335,7 @@ msgstr "" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Take a close look, especially at the things generated in `third_party/rust`." -msgstr "" +msgstr "特に `third_party/rust` 以下に生成されるものをよく確認してください。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" @@ -15823,6 +16343,9 @@ msgid "" "it's to allow multiple incompatible versions of a crate, which is " "discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" +"semver について、特に Chromium では互換性のないクレートのバージョンが複数許可" +"されることを説明しておきましょう。これは推奨されませんが、Cargo エコシステム" +"で必要になることがあります。" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" @@ -15831,68 +16354,78 @@ msgid "" "design of `gn` and `ninja` which aim for static, deterministic, build rules " "to maximize parallelism and repeatability of builds." msgstr "" +"ビルドが失敗した場合、`build.rs`(ビルド時に任意の処理を行うプログラム)が原" +"因である可能性があります。これは、ビルドの並列性と再現性を最大化するために静" +"的で決定的なビルドルールを目指す `gn` と `ninja` の設計とは、基本的に矛盾して" +"います。" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "Some `build.rs` actions are automatically supported; others require action:" msgstr "" +"一部の `build.rs` アクションは自動的にサポートされますが、他のアクションには" +"対応が必要です。" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" -msgstr "" +msgstr "ビルド スクリプトの効果" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Supported by our gn templates" -msgstr "" +msgstr "gn テンプレートによるサポート" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Work required by you" -msgstr "" +msgstr "必要な作業" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Checking rustc version to configure features on and off" -msgstr "" +msgstr "rustc のバージョンを確認して機能を有効または無効にする" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "None" -msgstr "" +msgstr "なし" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Checking platform or CPU to configure features on and off" -msgstr "" +msgstr "プラットフォームまたは CPU を確認して機能を有効または無効にする" #: src/chromium/adding-third-party-crates/resolving-problems.md #, fuzzy msgid "Generating code" -msgstr "ジェネリクス(generics)" +msgstr "コードの生成" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Yes - specify in `gnrt_config.toml`" -msgstr "" +msgstr "あり - `gnrt_config.toml` で指定する" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Building C/C++" -msgstr "" +msgstr "C/C++ のビルド" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Patch around it" -msgstr "" +msgstr "パッチを適用する" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Arbitrary other actions" -msgstr "" +msgstr "その他の任意のアクション" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" +"幸い、ほとんどのクレートにはビルド スクリプトが含まれておらず、ほとんどのビル" +"ド スクリプトは上位 2 つのアクションのみを実行します。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" +"`ninja`がファイルを見つけられないというメッセージを表示する場合は、`build." +"rs` がソースコード ファイルを作成しているかどうかを確認します。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -15902,6 +16435,11 @@ msgid "" "`allow-first-party-usage=false`. There are several examples already in that " "file:" msgstr "" +"もしファイルが作成されるようになっていたら、[`gnrt_config.toml`](../" +"configure-gnrt-config-toml.md) を変更して、クレートに `build-script-outputs` " +"を追加します。これが推移的依存関係(Chromium コードが直接依存すべきでない依存" +"関係)の場合は、`allow-first-party-usage=false` も追加します。このファイルに" +"は、すでにいくつかの例が含まれています。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -15911,6 +16449,11 @@ msgid "" "build-script-outputs = [\"tables.rs\"]\n" "```" msgstr "" +"```toml\n" +"[crate.unicode-linebreak]\n" +"allow-first-party-usage = false\n" +"build-script-outputs = [\"tables.rs\"]\n" +"```" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" @@ -15918,6 +16461,9 @@ msgid "" "`BUILD.gn` files to inform ninja that this particular output file is input " "to subsequent build steps." msgstr "" +"次に、[`gnrt.py -- gen`](../generating-gn-build-rules.md) を再実行して " +"`BUILD.gn` ファイルを再生成し、この特定の出力ファイルが後続のビルドステップで" +"入力されることを ninja に教えます。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" @@ -15927,18 +16473,24 @@ msgid "" "supported in a Chromium context --- our gn, ninja and LLVM build system is " "very specific in expressing relationships between build actions." msgstr "" +"一部のクレートは、[`cc`](https://crates.io/crates/cc) クレートを使用して、" +"C / C++ ライブラリのビルドとリンクを行います。他のクレートは、ビルド スクリプ" +"ト内で [`bindgen`](https://crates.io/crates/bindgen) を使用して C / C++ を解" +"析します。これらのアクションは、Chromium のコンテキストではサポートできませ" +"ん。Chromiumの gn、ninja、LLVM ビルドシステムは、ビルド アクション間の関係を" +"非常に具体的に表現するためです。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" -msgstr "" +msgstr "したがって、次のようなオプションがあります。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Avoid these crates" -msgstr "" +msgstr "これらのクレートを使用しない" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Apply a patch to the crate." -msgstr "" +msgstr "クレートにパッチを適用する" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" @@ -15948,6 +16500,11 @@ msgid "" "chromium_crates_io/patches/cxx/) - and will be applied automatically by " "`gnrt` each time it upgrades the crate." msgstr "" +"パッチは `third_party/rust/chromium_crates_io/patches/` に保存する必要" +"があります。たとえば、[`cxx` クレートに対するパッチ](https://source.chromium." +"org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/" +"cxx/) をご覧ください。また、パッチはクレートがアップグレードされるたびに " +"`gnrt` によって自動的に適用されます。" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" @@ -15955,10 +16512,13 @@ msgid "" "on a crate is simple. Find your `rust_static_library` target, and add a " "`dep` on the `:lib` target within your crate." msgstr "" +"サードパーティ クレートを追加してビルドルールを生成したら、クレートへの依存を" +"簡単に設定できます。`rust_static_library` ターゲットを見つけて、クレート内の " +"`:lib` ターゲットに `dep` を追加します。" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," -msgstr "" +msgstr "具体的には次のようにします。" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" @@ -15969,6 +16529,12 @@ msgid "" " +------------+ +----------------------+\n" "```" msgstr "" +"```bob\n" +" +------------+ +------------------------------+\n" +"\"//third_party/rust\" | クレート名 | \"/v\" | semver のメジャー バージョン " +"| \":lib\"\n" +" +------------+ +------------------------------+\n" +"```" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" @@ -15980,10 +16546,17 @@ msgid "" "}\n" "```" msgstr "" +"```gn\n" +"rust_static_library(\"my_rust_lib\") {\n" +" crate_root = \"lib.rs\"\n" +" sources = [ \"lib.rs\" ]\n" +" deps = [ \"//third_party/rust/example_rust_crate/v1:lib\" ]\n" +"}\n" +"```" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Auditing Third Party Crates" -msgstr "" +msgstr "サードパーティ クレートの監査" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" @@ -15994,17 +16567,27 @@ msgid "" "dependencies, there may be a lot of code to review. On the other hand, safe " "Rust code can have limited negative side effects. How should you review it?" msgstr "" +"新しいライブラリを追加する場合、Chromium の標準の [ポリシー](https://" +"chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." +"md#Third_party-review) が適用されますが、当然ながらセキュリティ審査の対象にも" +"なります。1 つのクレートだけでなく推移的依存関係も取り込む場合、審査すべき" +"コードが多数存在することがあります。その一方で、安全な Rust コードの取り込み" +"に関しては、悪い副作用は限定的となります。クレートの審査はどのように行われる" +"べきでしょうか。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Over time Chromium aims to move to a process based around [cargo vet]" "(https://mozilla.github.io/cargo-vet/)." msgstr "" +"Chromium は今後 [cargo vet](https://mozilla.github.io/cargo-vet/) を中心とし" +"たプロセスに移行されていく予定ですが、" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "" +"それまでの間、新しいクレートが追加されるたびに、以下のチェックを行います。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" @@ -16013,10 +16596,14 @@ msgid "" "macros, work out what they're for. Are they compatible with the way Chromium " "is normally built?" msgstr "" +"各クレートが使用されている理由と、クレート同士の関係を理解します。各クレート" +"のビルドシステムに`build.rs` または手続き型マクロが含まれている場合は、その目" +"的を調べます。また、Chromium の通常のビルド方法と互換性があるかどうかも確認し" +"ます。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check each crate seems to be reasonably well maintained" -msgstr "" +msgstr "各クレートが十分にメンテナンスされているか確認します。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" @@ -16025,6 +16612,10 @@ msgid "" "ironically involves downloading lots of dependencies from the internet[2](../" "cargo.md))" msgstr "" +"`cd third-party/rust/chromium_crates_io; cargo audit` を使用して既知の脆弱性" +"をチェックします(最初に `cargo install cargo-audit` を実行する必要があります" +"が、皮肉なことに、これによってインターネットから多くの依存関係をダウンロード" +"することになります [2](../cargo.md))。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" @@ -16032,10 +16623,13 @@ msgid "" "chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." "md#unsafe-code-in-safe-languages)" msgstr "" +"`unsafe` なコードが [Rule of Two](https://chromium.googlesource.com/chromium/" +"src/+/main/docs/security/rule-of-2.md#unsafe-code-in-safe-languages) を満たし" +"ていることを確認します。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" -msgstr "" +msgstr "`fs`および`net`のAPI が使用されているかどうかを確認します。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" @@ -16043,46 +16637,57 @@ msgid "" "that might have been maliciously inserted. (You can't realistically aim for " "100% perfection here: there's often just too much code.)" msgstr "" +"悪意を持って不正に挿入された可能性のある部分がないか探すのに十分なレベルで" +"コードを読みます(多くの場合、コードが多すぎて完璧にチェックすることはできま" +"せん)。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "These are just guidelines --- work with reviewers from `security@chromium." "org` to work out the right way to become confident of the crate." msgstr "" +"これらはガイドラインにすぎません。`security@chromium.org` の審査担当者と協力" +"して、自信を持ってクレートを使用するための適切な方法を見つけてください。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" -msgstr "" +msgstr "クレートを Chromium ソースコードにチェックインする" #: src/chromium/adding-third-party-crates/checking-in.md msgid "`git status` should reveal:" -msgstr "" +msgstr "`git status` を実行すると、以下を確認できます。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Crate code in `//third_party/rust/chromium_crates_io`" -msgstr "" +msgstr "`//third_party/rust/chromium_crates_io` にあるクレートコード" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" +"`//third_party/rust//` にあるメタデータ(`BUILD.gn` と " +"`README.chromium`)" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." -msgstr "" +msgstr "後者の場所に `OWNERS` ファイルも追加してください。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" "You should land all this, along with your `Cargo.toml` and `gnrt_config." "toml` changes, into the Chromium repo." msgstr "" +"これらすべてを、`Cargo.toml` および `gnrt_config.toml` の変更とともに " +"Chromium リポジトリに追加する必要があります。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" "**Important**: you need to use `git add -f` because otherwise `.gitignore` " "files may result in some files being skipped." msgstr "" +"**重要**: `git add -f` を使用する必要があります。そうしないと、`.gitignore` " +"ファイルによって一部のファイルがスキップされる可能性があるためです。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" @@ -16091,6 +16696,10 @@ msgid "" "branches, and many projects still use non-inclusive terminology there. So " "you may need to run:" msgstr "" +"その際、インクルーシブでない表現が原因で presubmit チェックが失敗することがあ" +"ります。これは、Rust のクレートデータには Git ブランチの名前が含まれている傾" +"向があり、多くのプロジェクトで依然としてインクルーシブでない表現が使用されて" +"いるためです。そのため、以下を実行する必要があります。" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" @@ -16100,6 +16709,11 @@ msgid "" "hoped that we will soon automate this for Rust crates, but for now, it's " "still your responsibility just as it is for any other third party dependency." msgstr "" +"サードパーティの Chromium 依存関係の所有者は、[セキュリティに関する修正を行っ" +"て依存関係を最新の状態に保つことが求められます](https://chromium." +"googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#add-" +"owners)。これはまもなく自動化されることが期待されていますが、現状は他のサード" +"パーティの依存関係の場合と同様に、デベロッパーがその責任を負います。" #: src/exercises/chromium/third-party.md msgid "" @@ -16108,6 +16722,10 @@ msgid "" "features.html#the-default-feature). Assume that the crate will be used in " "shipping Chromium, but won't be used to handle untrustworthy input." msgstr "" +"Chromium に [uwuify](https://crates.io/crates/uwuify) を追加し、クレートの " +"[デフォルトの機能](https://doc.rust-lang.org/cargo/reference/features." +"html#the-default-feature) を無効にします。クレートは Chromium の公開板で使用" +"されますが、信頼できない入力の処理には使用されないと仮定してください。" #: src/exercises/chromium/third-party.md msgid "" @@ -16116,71 +16734,81 @@ msgid "" "[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" "+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" +"(次の演習で Chromium の uwuify を使用しますが、ここで行っても構いません。ま" +"たは、`uwuify` を使用する新しい [`rust_executable` ターゲット](https://" +"source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_executable." +"gni) を作成することもできます)。" #: src/exercises/chromium/third-party.md msgid "Students will need to download lots of transitive dependencies." -msgstr "" +msgstr "受講者は多数の推移的依存関係をダウンロードする必要があります。" #: src/exercises/chromium/third-party.md msgid "The total crates needed are:" -msgstr "" +msgstr "必要なクレートは次のとおりです。" #: src/exercises/chromium/third-party.md msgid "`instant`," -msgstr "" +msgstr "`instant`" #: src/exercises/chromium/third-party.md msgid "`lock_api`," -msgstr "" +msgstr "`lock_api`" #: src/exercises/chromium/third-party.md msgid "`parking_lot`," -msgstr "" +msgstr "`parking_lot`" #: src/exercises/chromium/third-party.md msgid "`parking_lot_core`," -msgstr "" +msgstr "`parking_lot_core`" #: src/exercises/chromium/third-party.md msgid "`redox_syscall`," -msgstr "" +msgstr "`redox_syscall`" #: src/exercises/chromium/third-party.md msgid "`scopeguard`," -msgstr "" +msgstr "`scopeguard`" #: src/exercises/chromium/third-party.md msgid "`smallvec`, and" -msgstr "" +msgstr "`smallvec`" #: src/exercises/chromium/third-party.md msgid "`uwuify`." -msgstr "" +msgstr "`uwuify`" #: src/exercises/chromium/third-party.md msgid "" "If students are downloading even more than that, they probably forgot to " "turn off the default features." msgstr "" +"受講者が上記以外のクレートをダウンロードしている場合は、デフォルトの機能を無" +"効にするのを忘れている可能性があります。" #: src/exercises/chromium/third-party.md msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" +"このクレートに協力してくれた [Daniel Liu](https://github.com/Daniel-Liu-" +"c0deb0t) に感謝します。" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" -msgstr "" +msgstr "まとめ --- 演習" #: src/exercises/chromium/bringing-it-together.md msgid "" "In this exercise, you're going to add a whole new Chromium feature, bringing " "together everything you already learned." msgstr "" +"この演習では、Chromium の新しい機能を追加しながら、これまで学んだことをまとめ" +"ます。" #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" -msgstr "" +msgstr "プロダクト マネジメント部門からのブリーフィング" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16188,12 +16816,15 @@ msgid "" "It's important that we get Chromium for Pixies delivered to them as soon as " "possible." msgstr "" +"人里離れた熱帯雨林に生息するピクシー(妖精の一種)の村が発見されました。ピク" +"シー向けの Chromium をできるだけ早く提供することが重要です。" #: src/exercises/chromium/bringing-it-together.md msgid "" "The requirement is to translate all Chromium's UI strings into Pixie " "language." msgstr "" +"要件は、Chromium のすべての UI 文字列をピクシーの言語に翻訳することです。" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16201,22 +16832,28 @@ msgid "" "language is very close to English, and it turns out there's a Rust crate " "which does the translation." msgstr "" +"正式な翻訳を行っている時間はありませんが、幸いにもピクシーの言語は英語に非常" +"に近く、その翻訳を行う Rust クレートがあることがわかりました。" #: src/exercises/chromium/bringing-it-together.md msgid "" "In fact, you already [imported that crate in the previous exercise](https://" "crates.io/crates/uwuify)." msgstr "" +"実は、[前の演習でそのクレートをインポートしています](https://crates.io/" +"crates/uwuify)。" #: src/exercises/chromium/bringing-it-together.md msgid "" "(Obviously, real translations of Chrome require incredible care and " "diligence. Don't ship this!)" msgstr "" +"(言うまでもなく、Chrome を実際に翻訳するには細心の注意と努力が必要ですので、" +"これは公開しないでください)。" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" -msgstr "" +msgstr "手順" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16224,12 +16861,17 @@ msgid "" "strings before display. In this special build of Chromium, it should always " "do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" +"表示前にすべての文字列を翻訳するように `ResourceBundle::" +"MaybeMangleLocalizedString` を変更します。Chromium のこの特別なビルドでは、" +"`mangle_localized_strings_` の設定に関係なく、常にこのようにします。" #: src/exercises/chromium/bringing-it-together.md msgid "" "If you've done everything right across all these exercises, congratulations, " "you should have created Chrome for pixies!" msgstr "" +"ここまでの演習をすべて正しく終わらせれていれば、これでピクシー向けの Chrome " +"が完成しているはずです。" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16237,6 +16879,9 @@ msgid "" "and will probably decide that it's better to do the conversion on the C++ " "side using `base::UTF16ToUTF8` and back again." msgstr "" +"UTF16 と UTF8 について、受講者は Rust 文字列が常に UTF8 であることに注意する" +"必要があります。おそらく、C++ 側で `base::UTF16ToUTF8` を使用して変換、逆変換" +"する方がよいと判断するでしょう。" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16246,6 +16891,10 @@ msgid "" "[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" "slice.html)." msgstr "" +"Rust 側で変換を行う場合は、[`String::from_utf16`](https://doc.rust-lang.org/" +"std/string/struct.String.html#method.from_utf16)の利用、エラー処理、[多くの " +"u16s を転送可能な CXX でサポートされている型](https://cxx.rs/binding/slice." +"html) はどれかを検討する必要があります。" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16257,6 +16906,13 @@ msgid "" "mutable references to C++ data: the answer is that C++ data can't be moved " "around like Rust data, because it may contain self-referential pointers." msgstr "" +"受講者はいくつかの異なる方法で C++ と Rust の境界を設計できます。たとえば、文" +"字列を値で取得して返す、または文字列への可変参照を取得するなどです。可変参照" +"が使用されている場合は、おそらく CXX は [`Pin`](https://doc.rust-lang.org/" +"std/pin/) を使用する必要がある旨のメッセージを表示します。`Pin` の機能を説明" +"し、C++ データへの可変参照のために CXX で `Pin` が必要になる理由を説明する必" +"要があるかもしれません。答えは、C++ データには自己参照ポインタが含まれている" +"可能性があるため、Rust データのように移動できないためです。" #: src/exercises/chromium/bringing-it-together.md msgid "" @@ -16264,18 +16920,25 @@ msgid "" "need to depend on a `rust_static_library` target. The student probably " "already did this." msgstr "" +"`ResourceBundle::MaybeMangleLocalizedString` を含む C++ ターゲットは、" +"`rust_static_library` ターゲットに依存する必要があります。受講者はすでにこれ" +"を行っているはずです。" #: src/exercises/chromium/bringing-it-together.md msgid "" "The `rust_static_library` target will need to depend on `//third_party/rust/" "uwuify/v0_2:lib`." msgstr "" +"`rust_static_library` ターゲットは `//third_party/rust/uwuify/v0_2:lib` に依" +"存する必要があります。" #: src/exercises/chromium/solutions.md msgid "" "Solutions to the Chromium exercises can be found in [this series of CLs]" "(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" +"Chromium の演習の解答については、[こちらの CL シリーズ](https://chromium-" +"review.googlesource.com/c/chromium/src/+/5096560) をご覧ください。" #: src/bare-metal.md msgid "Welcome to Bare Metal Rust"