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

Combine add-missing with tree-filter? #287

Closed
jawa opened this issue Apr 23, 2018 · 2 comments
Closed

Combine add-missing with tree-filter? #287

jawa opened this issue Apr 23, 2018 · 2 comments
Labels

Comments

@jawa
Copy link
Contributor

jawa commented Apr 23, 2018

Hi, I've tried some variants of combining the commands but it seems that I can't get it right :-(

What I would like to do is to only add the missing translations in the specified tree filter, something like this:

i18n-tasks tree-filter 'articles.*' | i18n-tasks add-missing

Which would only add the missing keys in e.g. "articles" but not in "posts". Would it be possible to do?

Thanks for a great tool anyway!

@glebm
Copy link
Owner

glebm commented Apr 23, 2018

tree-filter needs a tree to operate on, e.g. you can pipe it to the output of data.

add-missing does not accept a tree. You can instead pipe with tree-mv SOURCE_LANGUAGE TARGET_LANGUAGE (e.g. tree-mv en fr) and then pipe with tree-set-value, and then data-merge.

For all of these except you need to specify the format (e.g. -f yaml), otherwise they will print in the terminal table format.

You can learn more about each command by running i18n-tasks COMMAND_NAME --help (e.g. i18n-tasks tree-set-value --help).

@glebm glebm added the question label Apr 23, 2018
@jawa
Copy link
Contributor Author

jawa commented Apr 26, 2018

Thanks!
I think I got what I wanted by doing something like this:
i18n-tasks missing -f yaml | i18n-tasks tree-filter 'articles.*' -f yaml | i18n-tasks tree-set-value 'TRME %{value}' -f yaml | i18n-tasks data-merge

@jawa jawa closed this as completed Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants