Using I18n sidecar assets outside the component #1648
-
I recently refactored my ViewComponents to use sidecar YML files for translations. click_on I18n.t('my_component.button_text') Now that def load_component_translations(component_name)
translations = YAML.load_file(Rails.root.join("app/components/#{component_name}.yml"))
locale = translations.keys.first
I18n.backend.store_translations(locale.to_sym, { component_name => translations[locale] })
end we can now execute Is this a great idea or we are just missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
@coorasse I'm not sure if this is exactly what would work, but perhaps we could do something like |
Beta Was this translation helpful? Give feedback.
#1656 reviews appreciated 🙏