Skip to content

Commit

Permalink
Refactor ApplicationHelper#tolk_locale_selection
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed May 8, 2010
1 parent a4dee96 commit 2507d84
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/helpers/tolk/application_helper.rb
Expand Up @@ -18,14 +18,11 @@ def yaml_value(value)
value
end


def tolk_locale_selection
existing_locale_names = Tolk::Locale.all.map(&:name)
pairs = Tolk::Locale::MAPPING.to_a.map(&:reverse)
pairs = pairs.sort_by(&:first)
pairs.reject do |pair|
existing_locale_names.include? pair.last
end

pairs = Tolk::Locale::MAPPING.to_a.map(&:reverse).sort_by(&:first)
pairs.reject {|pair| existing_locale_names.include?(pair.last) }
end
end
end

0 comments on commit 2507d84

Please sign in to comment.