Skip to content

Commit e86e5fe

Browse files
authoredOct 22, 2024··
docs: document that we need to translate user-facing texts (#966)
1 parent 2c2569c commit e86e5fe

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
 

‎.github/PULL_REQUEST_TEMPLATE.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
## Standards checklist
55

6-
- [ ] The PR title is descriptive.
6+
- [ ] The PR title is descriptive
77
- [ ] I have read `CONTRIBUTING.md`
88
- [ ] *Optional:* I have tested the code myself
9+
- [ ] If this PR introduces new user-facing messages they are translated
910

1011
## For new steps
1112

‎CONTRIBUTING.md

+18
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,24 @@ $ cargo test
129129

130130
Don't worry about other platforms, we have most of them covered in our CI.
131131

132+
## I18n
133+
134+
If your PR introduces user-facing messages, we need to ensure they are translated.
135+
Please add the translations to [`locales/app.yml`][app_yml]. For simple messages
136+
without arguments (e.g., "hello world"), we can simply translate them according
137+
(Tip: ChatGPT or similar LLMs is good at translation). If a message contains
138+
arguments, e.g., "hello <NAME>", please follow this convention:
139+
140+
```yml
141+
"hello {name}": # key
142+
en: "hello %{name}" # translation
143+
```
144+
145+
Arguments in the key should be in format `{argument_name}`, and they will have
146+
a preceeding `%` when used in translations.
147+
148+
[app_yml]: https://github.com/topgrade-rs/topgrade/blob/main/locales/app.yml
149+
132150
## Some tips
133151

134152
1. Locale

0 commit comments

Comments
 (0)
Please sign in to comment.