Module: LocaleKit
- Defined in:
- lib/locale_kit.rb,
lib/locale_kit/version.rb,
lib/generators/locale_kit.rb
Defined Under Namespace
Modules: Generators
Classes: Config, Engine, Reloader
Constant Summary
collapse
- VERSION =
'1.1.0'.freeze
Class Method Summary
collapse
Class Method Details
.app ⇒ Object
7
8
9
|
# File 'lib/locale_kit.rb', line 7
def app
Rails.application
end
|
.config ⇒ Object
12
13
14
|
# File 'lib/locale_kit.rb', line 12
def config
@config ||= LocaleKit::Config.instance
end
|
.locales ⇒ Object
17
18
19
|
# File 'lib/locale_kit.rb', line 17
def locales
Dir[app.root.join(config.directory, '**', '*.{yml,rb}')]
end
|
.reload! ⇒ Object
22
23
24
25
26
27
|
# File 'lib/locale_kit.rb', line 22
def reload!
I18n.load_path = (I18n.load_path + locales).uniq
I18n.backend.reload!
config.logger.try(:info, 'Reloaded locales by LocaleKit') if config.verbose
end
|