Class: Cmdx::LocaleGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Cmdx::LocaleGenerator
- Defined in:
- lib/generators/cmdx/locale_generator.rb
Overview
Generates CMDx locale files for Rails applications
Rails generator that copies CMDx locale files into the application’s config/locales directory. This allows applications to customize and extend the default CMDx locale files.
Instance Method Summary collapse
-
#copy_locale_files ⇒ void
Copies the locale template to the Rails application.
Instance Method Details
#copy_locale_files ⇒ void
This method returns an undefined value.
Copies the locale template to the Rails application
Copies the specified locale file from the gem’s locales directory to the application’s config/locales directory. If the locale file doesn’t exist in the gem, the generator will fail gracefully.
34 35 36 |
# File 'lib/generators/cmdx/locale_generator.rb', line 34 def copy_locale_files copy_file("#{locale}.yml", "config/locales/#{locale}.yml") end |