docs: document that we need to translate user-facing texts (#966)
This commit is contained in:
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
## Standards checklist
|
## Standards checklist
|
||||||
|
|
||||||
- [ ] The PR title is descriptive.
|
- [ ] The PR title is descriptive
|
||||||
- [ ] I have read `CONTRIBUTING.md`
|
- [ ] I have read `CONTRIBUTING.md`
|
||||||
- [ ] *Optional:* I have tested the code myself
|
- [ ] *Optional:* I have tested the code myself
|
||||||
|
- [ ] If this PR introduces new user-facing messages they are translated
|
||||||
|
|
||||||
## For new steps
|
## For new steps
|
||||||
|
|
||||||
|
|||||||
@@ -129,6 +129,24 @@ $ cargo test
|
|||||||
|
|
||||||
Don't worry about other platforms, we have most of them covered in our CI.
|
Don't worry about other platforms, we have most of them covered in our CI.
|
||||||
|
|
||||||
|
## I18n
|
||||||
|
|
||||||
|
If your PR introduces user-facing messages, we need to ensure they are translated.
|
||||||
|
Please add the translations to [`locales/app.yml`][app_yml]. For simple messages
|
||||||
|
without arguments (e.g., "hello world"), we can simply translate them according
|
||||||
|
(Tip: ChatGPT or similar LLMs is good at translation). If a message contains
|
||||||
|
arguments, e.g., "hello <NAME>", please follow this convention:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
"hello {name}": # key
|
||||||
|
en: "hello %{name}" # translation
|
||||||
|
```
|
||||||
|
|
||||||
|
Arguments in the key should be in format `{argument_name}`, and they will have
|
||||||
|
a preceeding `%` when used in translations.
|
||||||
|
|
||||||
|
[app_yml]: https://github.com/topgrade-rs/topgrade/blob/main/locales/app.yml
|
||||||
|
|
||||||
## Some tips
|
## Some tips
|
||||||
|
|
||||||
1. Locale
|
1. Locale
|
||||||
|
|||||||
Reference in New Issue
Block a user