Skip to content

Commit

Permalink
Merge pull request #69 from dyoo/skip
Browse files Browse the repository at this point in the history
Add support for skipping the next translation group
  • Loading branch information
mgeisler authored Sep 5, 2023
2 parents 53d4aca + 0a1c3f9 commit 08efd0b
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 15 deletions.
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mdbook = { version = "0.4.25", default-features = false }
polib = "0.2.0"
pulldown-cmark = { version = "0.9.2", default-features = false }
pulldown-cmark-to-cmark = "10.0.4"
regex = "1.9.4"
semver = "1.0.16"
serde_json = "1.0.91"

Expand Down
28 changes: 28 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,34 @@ Please see the [`publish.yml`] workflow in the Comprehensive Rust 🦀 repositor

[`publish.yml`]: /~https://github.com/google/comprehensive-rust/blob/main/.github/workflows/publish.yml

## Marking Sections to be Skipped for Translation

A block can be marked to be skipped for translation by prepending a special HTML
comment `<!--- mdbook-xgettext:skip -->` to it.

For example:

````markdown
The following code block should not be translated.

<!--- mdbook-xgettext:skip -->

```
fn hello() {
println!("Hello world!");
}
```

Itemized list:

- A should be translated.

<!--- mdbook-xgettext:skip -->

- B should be skipped.
- C should be translated.
````

## Normalizing Existing PO Files

When mdbook-i18n-helpers change, the generated PO files change as well. This can
Expand Down
Loading

0 comments on commit 08efd0b

Please sign in to comment.