Sha256: c74e2f1b4b5197f01d8299f0313deead23995ce5b7ae1ab696cfbba4b15cd92a
Contents?: true
Size: 592 Bytes
Versions: 69
Compression:
Stored size: 592 Bytes
Contents
module TrustyCms::AvailableLocales # Returns the list of available locale files in options_for_select format. # def self.locales available_locales = {} TrustyCms.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
69 entries across 69 versions & 1 rubygems