This repository has been archived on 2021-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
2018-12-06 16:00:22 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Load available languages.
|
|
|
|
|
|
|
|
configured_languages = []
|
|
|
|
|
2019-03-28 11:02:36 -04:00
|
|
|
locales = Dir.glob("#{Rails.root}/config/locales/*")
|
|
|
|
locales.each do |loc|
|
2018-12-06 16:00:22 -05:00
|
|
|
configured_languages.push(loc.split('/').last.split('.').first)
|
|
|
|
end
|
|
|
|
|
2019-03-28 11:02:36 -04:00
|
|
|
Rails.configuration.i18n.available_locales = configured_languages
|
2019-07-08 09:02:34 -04:00
|
|
|
|
|
|
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
|
|
# the I18n.default_locale when a translation cannot be found).
|
|
|
|
Rails.configuration.i18n.fallbacks = {}
|
|
|
|
Rails.configuration.i18n.available_locales.each do |locale|
|
|
|
|
Rails.configuration.i18n.fallbacks[locale] = :en
|
|
|
|
end
|