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

Support I18n locales for components #30

Open
msalzburg opened this issue Mar 21, 2019 · 1 comment
Open

Support I18n locales for components #30

msalzburg opened this issue Mar 21, 2019 · 1 comment

Comments

@msalzburg
Copy link
Contributor

msalzburg commented Mar 21, 2019

It would be nice to store component specific locales in the components directory (with
the components CSS and JS files) and enhance I18ns lazy lookup to support a "components" namespace.

Extending the i18n load path can be quite easy:

# config/application.rb

config.i18n.load_path += Dir[Rails.root.join('app', 'components', '**', '*.yml')]

I have not yet dug up how to define a "components" namespace for the lazy lookup.
Probably it would be nice to have a hierarchy like this:

# components/alert/alert_en.yml

en:
  components:
    alert:
       title: 'foo'
@jensljungblad
Copy link
Owner

Sounds like a good idea!

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