elemental_components
elemental_components copied to clipboard
Support I18n locales for components
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'
Sounds like a good idea!