mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 14:49:01 +02:00
1.0 KiB
1.0 KiB
Guidelines
- Use hierarchy whenever appropriate, try to group the messages by:
- Modals (e.g.
about.foo
,jump_to_note.foo
)
- Modals (e.g.
- Don't duplicate messages that are very widely used.
- One such example is
aria-label="Close"
which should go to a single message such asmodal.close
instead of being duplicated in every modal.
- One such example is
- On the other hand, don't overly generalise messages. A
close
message that is used whenever the “Close” word is encountered is not a good approach since it can potentially cause issues due to lack of context. - Use variable interpolation whenever appropriate.
- If you see multiple messages joined together only to apply add a variable such as a user-inputted value, try to join those messages together into a single message containing a variable.
- So instead of
“Number of updates: “ + numUpdates + “.”
use$(t("number_updates", { numUpdates }))
where the message translation would appear asNumber of updates: {{numUpdates}}.