Class: Locale::Generators::ComponentGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Locale::Generators::ComponentGenerator
- Includes:
- ViewComponent::AbstractGenerator
- Defined in:
- lib/rails/generators/locale/component_generator.rb
Instance Method Summary collapse
Methods included from ViewComponent::AbstractGenerator
Instance Method Details
#create_locale_file ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/rails/generators/locale/component_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 |