From b9abe706902c666d85cf60eb828a72c4f3062297 Mon Sep 17 00:00:00 2001 From: Inverle Date: Sun, 16 Nov 2025 18:44:07 +0100 Subject: 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. --- docs/en/internationalization.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/en/internationalization.md') 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: -- cgit v1.2.3