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

Documentation for renaming keys #274

Closed
mjgiarlo opened this issue Jan 8, 2018 · 2 comments
Closed

Documentation for renaming keys #274

mjgiarlo opened this issue Jan 8, 2018 · 2 comments
Milestone

Comments

@mjgiarlo
Copy link

mjgiarlo commented Jan 8, 2018

The compose tasks section of the README currently suggests using the deprecated tree-rename-key command to remove all keys in one locale that do not exist in another:

$ i18n-tasks missing -t diff -f yaml en | i18n-tasks tree-rename-key en fr | i18n-tasks data-remove

Invoking the same commands using tree-mv instead of tree-rename-key, however, does not yield the expected results. If e.g. removing crufty de keys based on en, I'd expect the output of the second operation in the pipe to show the root key changing from en to de; instead, I see:

en:
  de:
    etc:

Upon a very quick inspection, it seems this may be caused by root: false here:

forest.mv_key!(compile_key_pattern(from_pattern), to_pattern, root: false)

(I am using tree-rename-key for my needs in the meantime, so I don't currently have cycles to try tweaking root to true to see what happens.)

@glebm
Copy link
Owner

glebm commented Jan 8, 2018

Seems like a bug, all tree- commands should accept full keys (with root: true).

@glebm glebm closed this as completed in 191fc55 Jan 16, 2018
@glebm glebm added this to the v0.9.20 milestone Jan 16, 2018
@mjgiarlo
Copy link
Author

Thanks, @glebm!

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

No branches or pull requests

2 participants