aboutsummaryrefslogtreecommitdiff
path: root/docs/en
diff options
context:
space:
mode:
authorGravatar Inverle <inverle@proton.me> 2025-11-16 18:44:07 +0100
committerGravatar GitHub <noreply@github.com> 2025-11-16 18:44:07 +0100
commitb9abe706902c666d85cf60eb828a72c4f3062297 (patch)
tree887eae20f83b8e39bb515933615b4a39428b965e /docs/en
parentcf4d8043d2076ba346e9890a41984d458e94c8dc (diff)
Add new translate action: `move`, `make i18n-move-key` (#8214)
So that renaming something like `conf.shortcut.toggle_sidebar` to `conf.shortcut.toggle_aside` can be done easily even after already having added `conf.shortcut.toggle_sidebar` and translated it in multiple languages. Example of usage: ```console ./cli/manipulate.translation.php -a move -k conf.shortcut.toggle_sidebar -n conf.shortcut.toggle_aside ``` ```console make i18n-move-key key="conf.shortcut.toggle_sidebar" new-key="conf.shortcut.toggle_aside" ``` The key will be moved and all values/states will be kept.
Diffstat (limited to 'docs/en')
-rw-r--r--docs/en/internationalization.md7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/en/internationalization.md b/docs/en/internationalization.md
index a2accd2d7..c40285c4a 100644
--- a/docs/en/internationalization.md
+++ b/docs/en/internationalization.md
@@ -83,7 +83,7 @@ make i18n-ignore-key lang=fr key=index.about.version
This command adds an IGNORE comment on the translation so the key can be considered as translated.
-## Add/remove/update a key
+## Add/remove/update/rename a key
If you’re developing a new part of the application, you might want to declare a new translation key. Your first impulse would be to add the key to each file manually: don’t do that, it’s very painful. We provide another command:
@@ -107,6 +107,11 @@ make i18n-update-key key=the.key.to.change value='The new string in English'
The key will simply be removed and added back with the new value.
+If you want to move/rename a key, you can use:
+```sh
+make i18n-move-key key=the.key.to.move new-key=new.location.of.the.key
+```
+
## How to access a translation programmatically
To access these translations, you must use the `_t()` function (which is a shortcut for `Minz_Translate::t()`). Code example: