Commit dd350afda895a941580437712760bbf264168661

Authored by Rodrigo Souto
2 parents dde6f437 acc3fcba

Merge branch 'fix_translation_marks' into 'master'

fix translation marks

 Moved translations from constant to method, otherwise they wont be translated. Also, fix translation marks missing for a string.

See merge request !924
Showing 1 changed file with 6 additions and 4 deletions   Show diff stats
app/helpers/users_helper.rb
1 1 module UsersHelper
2 2  
3   - FILTER_TRANSLATION = {
  3 + def filter_translation
  4 + {
4 5 'all_users' => _('All users'),
5 6 'admin_users' => _('Admin users'),
6 7 'activated_users' => _('Activated users'),
7 8 'deactivated_users' => _('Deativated users'),
8   - }
  9 + }
  10 + end
9 11  
10 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 14 url_params = url_for(params.merge(:filter => 'FILTER'))
13 15 onchange = "document.location.href = '#{url_params}'.replace('FILTER', this.value)"
14 16 select_field = select_tag(:filter, options, :onchange => onchange)
... ... @@ -19,7 +21,7 @@ module UsersHelper
19 21 end
20 22  
21 23 def users_filter_title(filter)
22   - FILTER_TRANSLATION[filter]
  24 + filter_translation[filter]
23 25 end
24 26  
25 27 end
... ...