Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enh: add maintenance script to rename a key in locales #605

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

Axolotle
Copy link
Member

Added a script so that you can rename a nested i18n key in 'en' or all locales.
This won't change the value, only move the key.
Also added commands to README.md

Examples:

If you need to rename a key or more (from 'my.current.key' to 'my.new.key' for example).

From a string

python3 rename_i18n_keys.py --keys my.current.key:my.new.key

From a file

python3 rename_i18n_keys.py --file input.txt

input.txt

my.current.key:my.new.key
my.other.key:my.new.other.key

By default it renames keys only in the en.json, pass --all to apply changes to all locales file.

@Axolotle Axolotle merged commit 17b0a81 into dev Dec 10, 2024
1 check passed
@Axolotle Axolotle deleted the enh-i18n-maintenance branch December 10, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant