1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-21 08:19:32 +02:00

Skip some untranslatable code blocks (#1258)

This builds on the work of @dyoo in
https://github.com/google/mdbook-i18n-helpers/pull/69: by adding a
special `<!-- mdbook-xgettext: skip -->` comment, we can skip the
following code block.

I also modified a few code blocks to remove translatable text: variable
names are not expected to be translated, so it’s fine to have a line
with `println!("foo: {foo}")` in the code block.

This PR removes 36 messages from the POT file. The number of lines drop
by 633 (3%).

Part of #1257.
This commit is contained in:
Martin Geisler
2023-09-26 17:04:46 +02:00
committed by GitHub
parent a492b2f1b2
commit d0e0e5c1af
27 changed files with 49 additions and 14 deletions

View File

@ -8,6 +8,7 @@ let array = [10, 20, 30];
You can print such an array by asking for its debug representation with `{:?}`:
<!-- mdbook-xgettext: skip -->
```rust,editable
fn main() {
let array = [10, 20, 30];
@ -38,6 +39,7 @@ fn main() {
Use the above to write a function `pretty_print` which pretty-print a matrix and
a function `transpose` which will transpose a matrix (turn rows into columns):
<!-- mdbook-xgettext: skip -->
```bob
⎛⎡1 2 3⎤⎞ ⎡1 4 7⎤
"transpose"⎜⎢4 5 6⎥⎟ "=="⎢2 5 8⎥

View File

@ -3,6 +3,7 @@
Rust will not automatically apply _implicit conversions_ between types ([unlike
C++][3]). You can see this in a program like this:
<!-- mdbook-xgettext: skip -->
```rust,editable,compile_fail
fn multiply(x: i16, y: i16) -> i16 {
x * y