-
Notifications
You must be signed in to change notification settings - Fork 264
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
Move key tree #116
Comments
You can rename a key, e.g.:
|
Thanks. |
What if I want to move en.company.posts -> en.admin.posts? |
@dsmalko That would be a feature i18n-tasks doesn't support yet. I would accept a PR adding a |
This adds the ability to move a node/leaf to a different position in the tree. It duplicates some of the functionality of rename tool but supports additional features such as moving a key 'up'/'down' the tree as well as moving an entire node/sub-tree. Example Usage: -------------- given: en.yml ``` en: date: abbr_day_names: - Sun - Mon ``` If we run `i18n-tasks data en -fyaml | i18n-tasks tree-mv-key :.date day_names > example.yml` the resulting structure will be ``` en: date_day_names: abbr_day_names: - Sun - Mon ``` Alternatively `i18n-tasks data en -yaml | i18n-tasks tree-mv-key :.date.abbr_day_names day_names` will yield ``` en: day_names: - Sun - Mon ```
My thoughts on what this should look like (from a comment in #126). Move / rename / merge keys
Rename a node (leaf or subtree): $ i18n-tasks mv user account Move a node: $ i18n-tasks mv user_alerts user.alerts Move the children one level up: $ i18n-tasks mv 'alerts.{:}' '\1' Merge-move multiple nodes: $ i18n-tasks mv '{user,profile}' account Merge nodes into parent: $ i18n-tasks mv 'pages.{a,b}' pages |
Move keys easily from the command line! Fixes #116
Move keys easily from the command line! Fixes #116
Move keys easily from the command line! Fixes #116
Released in v0.9.8! 🎅 |
Is there a way to move key trees in multiple locales? Like change en.posts -> en.articles
The text was updated successfully, but these errors were encountered: