Sha256: 1f362971ad7e3b79abbb7045dac2c824e317229903e3a30f69f4229d77804298

Contents?: true

Size: 542 Bytes

Versions: 6

Compression:

Stored size: 542 Bytes

Contents

module Admin::SettingsHelper
  require 'find'
  
  def fetch_langs
    options = content_tag(:option, "Select lang", :value => 'en_US')
	Find.find(RAILS_ROOT + "/lang") do |lang|
	  if lang =~ /\.rb$/
        lang_pattern = File.basename(lang).gsub(".rb", '')
        if this_blog.lang == lang_pattern
          options << content_tag(:option, lang_pattern, :value => lang_pattern, :selected => 'selected')
        else
          options << content_tag(:option, lang_pattern, :value => lang_pattern)
        end
	  end
	end
	options
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typo-5.0.3.98.1 app/helpers/admin/settings_helper.rb
typo-5.0.3.98 app/helpers/admin/settings_helper.rb
typo-5.1.1 app/helpers/admin/settings_helper.rb
typo-5.1.2 app/helpers/admin/settings_helper.rb
typo-5.1.3 app/helpers/admin/settings_helper.rb
typo-5.1 app/helpers/admin/settings_helper.rb