Skip to content

Commit

Permalink
Merge pull request #177 from dyoo/usage-docs
Browse files Browse the repository at this point in the history
Adjust USAGE.md to document the translator comments work.
  • Loading branch information
dyoo authored Mar 5, 2024
2 parents e937143 + 97f4fb5 commit 79da7bf
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions i18n-helpers/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,36 @@ 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 with a comment

A block can be marked with a comment for translation by prepending a special
HTML comment `<!-- i18n:comment: XXX -->` in front of it. Consecutive HTML
comments will be collected into a single translation comment.

For example:

```markdown
The following will have a comment attached to the message.

But what is a man,

<!-- i18n:comment: ...a miserable little pile of secrets. -->
<!-- i18n:comment: But enough talk! -->

what has he got. If not himself, then he has naught.
```

## 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.
comment `<!-- i18n:skip -->` in front of it.

For example:

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

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

```
fn hello() {
Expand All @@ -214,7 +233,7 @@ Itemized list:

- A should be translated.

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

- B should be skipped.
- C should be translated.
Expand Down

0 comments on commit 79da7bf

Please sign in to comment.