Commit acc3fcba34490828b499a01ea1787d69c62ee7e5
1 parent
9b61dc02
Exists in
ratings_minor_fixes
and in
3 other branches
fix translation marks
Showing
1 changed file
with
6 additions
and
4 deletions
Show diff stats
app/helpers/users_helper.rb
1 | module UsersHelper | 1 | module UsersHelper |
2 | 2 | ||
3 | - FILTER_TRANSLATION = { | 3 | + def filter_translation |
4 | + { | ||
4 | 'all_users' => _('All users'), | 5 | 'all_users' => _('All users'), |
5 | 'admin_users' => _('Admin users'), | 6 | 'admin_users' => _('Admin users'), |
6 | 'activated_users' => _('Activated users'), | 7 | 'activated_users' => _('Activated users'), |
7 | 'deactivated_users' => _('Deativated users'), | 8 | 'deactivated_users' => _('Deativated users'), |
8 | - } | 9 | + } |
10 | + end | ||
9 | 11 | ||
10 | def filter_selector(filter, float = 'right') | 12 | def filter_selector(filter, float = 'right') |
11 | - options = options_for_select(FILTER_TRANSLATION.map {|key, name| [name, key]}, :selected => filter) | 13 | + options = options_for_select(filter_translation.map {|key, name| [name, key]}, :selected => filter) |
12 | url_params = url_for(params.merge(:filter => 'FILTER')) | 14 | url_params = url_for(params.merge(:filter => 'FILTER')) |
13 | onchange = "document.location.href = '#{url_params}'.replace('FILTER', this.value)" | 15 | onchange = "document.location.href = '#{url_params}'.replace('FILTER', this.value)" |
14 | select_field = select_tag(:filter, options, :onchange => onchange) | 16 | select_field = select_tag(:filter, options, :onchange => onchange) |
@@ -19,7 +21,7 @@ module UsersHelper | @@ -19,7 +21,7 @@ module UsersHelper | ||
19 | end | 21 | end |
20 | 22 | ||
21 | def users_filter_title(filter) | 23 | def users_filter_title(filter) |
22 | - FILTER_TRANSLATION[filter] | 24 | + filter_translation[filter] |
23 | end | 25 | end |
24 | 26 | ||
25 | end | 27 | end |