[Git][noosfero/noosfero][master] 2 commits: fix translation marks
Rodrigo Souto
gitlab at mg.gitlab.com
Tue May 17 17:49:11 BRT 2016
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
acc3fcba by Marcos Ronaldo at 2016-05-17T17:32:21-03:00
fix translation marks
- - - - -
dd350afd by Rodrigo Souto at 2016-05-17T20:48:57+00:00
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
- - - - -
1 changed file:
- app/helpers/users_helper.rb
Changes:
=====================================
app/helpers/users_helper.rb
=====================================
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -1,14 +1,16 @@
module UsersHelper
- FILTER_TRANSLATION = {
+ def filter_translation
+ {
'all_users' => _('All users'),
'admin_users' => _('Admin users'),
'activated_users' => _('Activated users'),
'deactivated_users' => _('Deativated users'),
- }
+ }
+ end
def filter_selector(filter, float = 'right')
- options = options_for_select(FILTER_TRANSLATION.map {|key, name| [name, key]}, :selected => filter)
+ options = options_for_select(filter_translation.map {|key, name| [name, key]}, :selected => filter)
url_params = url_for(params.merge(:filter => 'FILTER'))
onchange = "document.location.href = '#{url_params}'.replace('FILTER', this.value)"
select_field = select_tag(:filter, options, :onchange => onchange)
@@ -19,7 +21,7 @@ module UsersHelper
end
def users_filter_title(filter)
- FILTER_TRANSLATION[filter]
+ filter_translation[filter]
end
end
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/dde6f4374066a100abd75d215afb2f4be2d1866c...dd350afda895a941580437712760bbf264168661
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160517/c8bfd0d7/attachment-0001.html>
More information about the Noosfero-dev
mailing list