Sha256: c64313c1fbb18e129de339e3154368b25595a3db02a6e9ddadd50b34edb315ee

Contents?: true

Size: 589 Bytes

Versions: 15

Compression:

Stored size: 589 Bytes

Contents

module Kaui
  module LocaleHelper

    def get_available_locales
      locale_yaml_file = File.join(File.dirname(__FILE__), 'locale_helper.yml')
      available_locales = YAML::load_file(locale_yaml_file)

      favorites = []
      locales = []

      available_locales.each do |locale|
        option = ["#{locale[:language]} #{locale[:country]} (#{locale[:language_tag]})", locale[:language_tag] ]
        locales << option unless locale[:favorite]
        favorites << option if locale[:favorite]
      end

      favorites.concat(['---------------']).concat(locales)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kaui-2.1.0 app/helpers/kaui/locale_helper.rb
kaui-2.0.4 app/helpers/kaui/locale_helper.rb
kaui-2.0.3 app/helpers/kaui/locale_helper.rb
kaui-2.0.2 app/helpers/kaui/locale_helper.rb
kaui-2.0.1 app/helpers/kaui/locale_helper.rb
kaui-2.0.0 app/helpers/kaui/locale_helper.rb
kaui-1.4.1 app/helpers/kaui/locale_helper.rb
kaui-1.4.0 app/helpers/kaui/locale_helper.rb
kaui-1.3.0 app/helpers/kaui/locale_helper.rb
kaui-1.2.0 app/helpers/kaui/locale_helper.rb
kaui-1.1.0 app/helpers/kaui/locale_helper.rb
kaui-1.0.0 app/helpers/kaui/locale_helper.rb
kaui-0.16.2 app/helpers/kaui/locale_helper.rb
kaui-0.16.1 app/helpers/kaui/locale_helper.rb
kaui-0.16.0 app/helpers/kaui/locale_helper.rb