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

Adapter not found for ERB files #253

Closed
mjgiarlo opened this issue Jul 25, 2017 · 2 comments
Closed

Adapter not found for ERB files #253

mjgiarlo opened this issue Jul 25, 2017 · 2 comments
Labels

Comments

@mjgiarlo
Copy link

mjgiarlo commented Jul 25, 2017

@glebm I maintain a Rails engine that generates YAML translations into applications, and some of these are .yml.erb files. You can see an example here:

https://github.com/samvera/hyrax/blob/master/lib/generators/hyrax/work/templates/locale.de.yml.erb

When I ask i18n-tasks to add missing translations for these files, I (understandably) get the following error:

i18n-tasks: Adapter not found for lib/generators/hyrax/work/templates/locale.en.yml.erb. Registered adapters: [[:yaml, "*.yml", I18n::Tasks::Data::Adapter::YamlAdapter], [:json, "*.json", i18n::Tasks::Data::Adapter::JsonAdapter]]

How would you recommend I handle this? Is there a pattern you'd recommend? Would you prefer a PR, or should I handle this locally?

@glebm
Copy link
Owner

glebm commented Aug 10, 2017

i18n-tasks does not support .erb locale files.

What you can do is:

  1. Remove this line from your config.
  2. Add the keys in the .erb files to ignore_missing.

In general, I would suggest not using .erb locale files.

@mjgiarlo
Copy link
Author

👌, that'll do. Thanks, @glebm, for working on this super useful gem!

mjgiarlo added a commit to samvera/hyrax that referenced this issue Aug 10, 2017
This is unsupported by i18n-tasks so it prevents the command from running. The maintainer of that gem does not intend to support ERB: glebm/i18n-tasks#253 (comment).

Refs #1276, #1451
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