Module: I18nAccessors
- Defined in:
- lib/i18n_accessors.rb,
lib/i18n_accessors/methods.rb,
lib/i18n_accessors/missing.rb,
lib/i18n_accessors/version.rb
Defined Under Namespace
Classes: Configuration, Methods, Missing
Constant Summary collapse
- VERSION =
"1.0.0"
Configuration Methods collapse
-
.config ⇒ I18nAccessors::Configuration
I18nAccessors configuration.
-
.i18n_class ⇒ Class
I18n Class to use for setting locale.
-
.normalize_locale(locale = I18n.locale) ⇒ String
Return normalized locale.
Class Method Summary collapse
-
.configure {|I18nAccessors::Configuration| ... } ⇒ Object
Configure I18nAccessors.
Class Method Details
.config ⇒ I18nAccessors::Configuration
Returns I18nAccessors configuration.
16 17 18 |
# File 'lib/i18n_accessors.rb', line 16 def config @configuration ||= Configuration.new end |
.configure {|I18nAccessors::Configuration| ... } ⇒ Object
Configure I18nAccessors
10 11 12 |
# File 'lib/i18n_accessors.rb', line 10 def configure yield config end |
.i18n_class ⇒ Class
Returns I18n Class to use for setting locale.
21 22 23 |
# File 'lib/i18n_accessors.rb', line 21 def i18n_class config.i18n_class end |
.normalize_locale(locale = I18n.locale) ⇒ String
Return normalized locale
33 34 35 |
# File 'lib/i18n_accessors.rb', line 33 def normalize_locale(locale = I18n.locale) "#{locale.to_s.downcase.sub("-", "_")}".freeze end |