-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add dprint
step to TRANSLATIONS.md
#1363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ directory. The `.po` files are small text-based translation databases. | |
|
||
> **Important:** If you are planning to use [Poedit](https://poedit.net/) as | ||
> suggested above, make sure to follow the | ||
> [additional configuration steps](#Additional-Configuration-for-Poedit) below | ||
> [additional configuration steps](#additional-configuration-for-poedit) below | ||
> to ensure the `.po` file is correctly formatted. | ||
|
||
There is a `.po` file for each language. They are named after the [ISO 639] | ||
|
@@ -32,15 +32,35 @@ GNU Gettext utilities below. | |
|
||
## Preparation | ||
|
||
You will need the [Gettext] utilities (`msginit`, `msgmerge`). Under Debian and | ||
Ubuntu, you can install with: | ||
### Installing Gettext | ||
|
||
You will need the [Gettext] utilities (`msginit`, `msgmerge`). | ||
|
||
Under Debian and Ubuntu, you can install with: | ||
|
||
```shell | ||
sudo apt install gettext | ||
``` | ||
|
||
On MacOS with [Homebrew](https://brew.sh/), you can install with: | ||
|
||
```shell | ||
brew install gettext | ||
``` | ||
|
||
### Installing dprint | ||
|
||
We use [dprint](https://dprint.dev/) to format the `.po` files. You can install | ||
with: | ||
|
||
```shell | ||
cargo install dprint | ||
``` | ||
|
||
### Installing mdbook tools | ||
|
||
Ensure you can build the book, and that `mdbook serve` works. For this, follow | ||
the instructions in the [README](README.md). | ||
the instructions in the [README](README.md#building). | ||
|
||
## Creating and Updating Translations | ||
|
||
|
@@ -149,6 +169,15 @@ will need to change a few things from their default configuration: | |
|
||
 | ||
|
||
### Formatting a Translation | ||
|
||
You should run `dprint` on your `.po` file to ensure it is formatted correctly. | ||
You can do this with: | ||
|
||
```shell | ||
dprint fmt po/xx.po | ||
``` | ||
Comment on lines
+172
to
+179
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also a nice thing to add! |
||
|
||
## Using Translations | ||
|
||
This will show you how to use the translations to generate localized HTML | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think it would be good to add instructions for MacOS like you do here.