aboutsummaryrefslogtreecommitdiffstats
path: root/lib/alaveteli_localization.rb
blob: 25de002c4e99c9cfc699594f10676a59646d671b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class AlaveteliLocalization
    class << self
        def set_locales(available_locales, default_locale)
            # fallback locale and available locales
            available_locales = available_locales.split(/ /)
            FastGettext.default_available_locales = available_locales
            I18n.locale = default_locale
            I18n.available_locales = available_locales.map { |locale_name| locale_name.to_sym }
            I18n.default_locale = default_locale
        end

    end
end