Class: ViewComponent::Generators::LocaleGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ViewComponent::Generators::LocaleGenerator
- Includes:
- AbstractGenerator
- Defined in:
- lib/generators/view_component/locale/locale_generator.rb
Instance Method Summary collapse
Methods included from AbstractGenerator
Instance Method Details
#create_locale_file ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/view_component/locale/locale_generator.rb', line 14 def create_locale_file if ViewComponent::Base.config.generate.distinct_locale_files I18n.available_locales.each do |locale| create_file destination(locale), translations_hash([locale]).to_yaml end else create_file destination, translations_hash(I18n.available_locales).to_yaml end end |