Class: AdSpace::I18nConfig

Inherits:
I18n::Config
  • Object
show all
Defined in:
app/models/ad_space/i18n_config.rb

Constant Summary collapse

BACKEND =
I18n::Backend::Simple.new
AVAILABLE_LOCALES =
AdSpace::Engine.root.join("config/locales").glob("*.yml").map { |path| File.basename(path, ".yml").to_sym }.uniq
AVAILABLE_LOCALES_SET =
AVAILABLE_LOCALES.inject(Set.new) { |set, locale| set << locale.to_s << locale.to_sym }

Instance Method Summary collapse

Instance Method Details

#available_localesObject



13
14
15
# File 'app/models/ad_space/i18n_config.rb', line 13

def available_locales
  AVAILABLE_LOCALES
end

#available_locales_setObject



17
18
19
# File 'app/models/ad_space/i18n_config.rb', line 17

def available_locales_set
  AVAILABLE_LOCALES_SET
end

#backendObject



9
10
11
# File 'app/models/ad_space/i18n_config.rb', line 9

def backend
  BACKEND
end

#default_localeObject



21
22
23
# File 'app/models/ad_space/i18n_config.rb', line 21

def default_locale
  AdSpace.configuration.dashboard_default_locale
end