elemental_components icon indicating copy to clipboard operation
elemental_components copied to clipboard

Support I18n locales for components

Open msalzburg opened this issue 5 years ago • 1 comments

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'

msalzburg avatar Mar 21 '19 15:03 msalzburg

Sounds like a good idea!

jensljungblad avatar Mar 26 '19 15:03 jensljungblad