Sha256: 1e806c47bdeb144302559704f31439b4d07d26b4e6efcd6aa56ed2882afdf511

Contents?: true

Size: 589 Bytes

Versions: 13

Compression:

Stored size: 589 Bytes

Contents

module Radiant::AvailableLocales
  
  # Returns the list of available locale files in options_for_select format.
  #
  def self.locales
    available_locales = {}
    Radiant.configuration.i18n.load_path.each do |path|
      if File.exists?(path) && path !~ /_available_tags/
        locale_yaml = YAML.load_file(path)
        stem = File.basename(path, '.yml')
        if locale_yaml[stem] && lang = locale_yaml[stem]["this_file_language"]
          available_locales[lang] = stem
        end
      end
    end
    available_locales.collect {|k,v| [k, v]}.sort_by { |s| s[0] }
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
radiant-1.1.4 lib/radiant/available_locales.rb
radiant-1.1.3 lib/radiant/available_locales.rb
radiant-1.1.2 lib/radiant/available_locales.rb
radiant-1.1.1 lib/radiant/available_locales.rb
radiant-1.1.0 lib/radiant/available_locales.rb
radiant-1.1.0.rc1 lib/radiant/available_locales.rb
radiant-1.1.0.beta lib/radiant/available_locales.rb
radiant-1.0.1 lib/radiant/available_locales.rb
radiant-1.1.0.alpha lib/radiant/available_locales.rb
radiant-1.0.0 lib/radiant/available_locales.rb
radiant-1.0.0.rc5 lib/radiant/available_locales.rb
radiant-1.0.0.rc4 lib/radiant/available_locales.rb
radiant-1.0.0.rc3 lib/radiant/available_locales.rb