Locale/localeapp

Selective key pull fails

pirj opened this issue · 1 comments

pirj commented

We're working in a team, and there can be a significant number of translations unrelated to my changes.
So to avoid a time consuming (would be much worse if we had 100 languages, but we only have ~20) git add -p, I try to:

$ localeapp pull users.form.title

and it gives me:

Fetching users.form.title translations:
Success!
Updating backend:
error: Could not find given locale

There are actually three problems with that:

  1. raise "Could not find given locale" unless yaml_data and yaml_data[locale_key]
    is implying that yaml_data supports key format user.form.title, but it doesn't actually:
yaml_data['users.form.title'] # => nil
yaml_data['en']['users']['form']['title'] => 'Title'
  1. It implies that I want to pull the key for a single locale, e.g. en. However, my intention is to pull the key for all of the locales our app supports, so en.users.form.title, fr.users.form.title, bg.users.form.title etc.

  2. It does not accept multiple keys, while it non-ambiguously could:

$ localeapp pull users.form.title users.show.name users.show.surname

Would you accept a pull request to fix those problems?

Hi @pirj,

Thank you for your feedback 👍
Your suggestion sounds promising, I would be happy to review a PR for this feature!
We are always opened to merge a PRs as long as it includes tests.

Cheers 👋