diff --git a/app/api/helpers.rb b/app/api/helpers.rb index 2a26b38..6fa9468 100644 --- a/app/api/helpers.rb +++ b/app/api/helpers.rb @@ -302,12 +302,12 @@ module Api end def cant_be_saved_request!(attribute) - message = _("(Invalid request) %s can't be saved") % attribute + message = _("(Invalid request) %s can't be saved").html_safe % attribute render_api_error!(message, 400) end def bad_request!(attribute) - message = _("(Invalid request) %s not given") % attribute + message = _("(Invalid request) %s not given").html_safe % attribute render_api_error!(message, 400) end diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index 321ec23..8f5f1a2 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -44,7 +44,7 @@ class CategoriesController < AdminController if request.post? @category.update!(params[:category]) @saved = true - session[:notice] = _("Category %s saved." % @category.name) + session[:notice] = _("Category %s saved." % @category.name).html_safe redirect_to :action => 'index' end rescue Exception => e diff --git a/app/controllers/box_organizer_controller.rb b/app/controllers/box_organizer_controller.rb index 557c6ed..523806c 100644 --- a/app/controllers/box_organizer_controller.rb +++ b/app/controllers/box_organizer_controller.rb @@ -109,7 +109,7 @@ class BoxOrganizerController < ApplicationController def show_block_type_info type = params[:type] if type.blank? || !available_blocks.map(&:name).include?(type) - raise ArgumentError.new("Type %s is not allowed. Go away." % type) + raise ArgumentError.new("Type %s is not allowed. Go away.".html_safe % type) end @block = type.constantize.new @block.box = Box.new(:owner => boxes_holder) @@ -122,7 +122,7 @@ class BoxOrganizerController < ApplicationController def new_block(type, box) if !available_blocks.map(&:name).include?(type) - raise ArgumentError.new("Type %s is not allowed. Go away." % type) + raise ArgumentError.new("Type %s is not allowed. Go away.".html_safe % type) end block = type.constantize.new box.blocks << block diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index 3eb6021..20c4564 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -205,7 +205,7 @@ class AccountController < ApplicationController if params[:value].blank? @change_password.errors[:base] << _('Can not recover user password with blank value.') else - @change_password.errors[:base] << _('Could not find any user with %s equal to "%s".') % [fields_label, params[:value]] + @change_password.errors[:base] << _('Could not find any user with %s equal to "%s".').html_safe % [fields_label, params[:value]] end rescue ActiveRecord::RecordInvalid @change_password.errors[:base] << _('Could not perform password recovery for the user.') diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index cccc352..b28ec69 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -42,8 +42,8 @@ class ProfileController < PublicController feed_writer = FeedWriter.new data = feed_writer.write( tagged, - :title => _("%s's contents tagged with \"%s\"") % [profile.name, @tag], - :description => _("%s's contents tagged with \"%s\"") % [profile.name, @tag], + :title => _("%s's contents tagged with \"%s\"").html_safe % [profile.name, @tag], + :description => _("%s's contents tagged with \"%s\"").html_safe % [profile.name, @tag], :link => url_for(profile.url) ) render :text => data, :content_type => "text/xml" @@ -88,7 +88,7 @@ class ProfileController < PublicController def join_modal profile.add_member(user) - session[:notice] = _('%s administrator still needs to accept you as member.') % profile.name + session[:notice] = _('%s administrator still needs to accept you as member.').html_safe % profile.name redirect_to :action => :index end @@ -98,12 +98,12 @@ class ProfileController < PublicController profile.add_member(user) if !profile.members.include?(user) - render :text => {:message => _('%s administrator still needs to accept you as member.') % profile.name}.to_json + render :text => {:message => _('%s administrator still needs to accept you as member.').html_safe % profile.name}.to_json else - render :text => {:message => _('You just became a member of %s.') % profile.name}.to_json + render :text => {:message => _('You just became a member of %s.').html_safe % profile.name}.to_json end else - render :text => {:message => _('You are already a member of %s.') % profile.name}.to_json + render :text => {:message => _('You are already a member of %s.').html_safe % profile.name}.to_json end end @@ -125,7 +125,7 @@ class ProfileController < PublicController render :text => current_person.leave(profile, params[:reload]) end else - render :text => {:message => _('You are not a member of %s.') % profile.name}.to_json + render :text => {:message => _('You are not a member of %s.').html_safe % profile.name}.to_json end end @@ -145,9 +145,9 @@ class ProfileController < PublicController # FIXME this shouldn't be in Person model? if !user.memberships.include?(profile) AddFriend.create!(:person => user, :friend => profile) - render :text => _('%s still needs to accept being your friend.') % profile.name + render :text => _('%s still needs to accept being your friend.').html_safe % profile.name else - render :text => _('You are already a friend of %s.') % profile.name + render :text => _('You are already a friend of %s.').html_safe % profile.name end end @@ -178,7 +178,7 @@ class ProfileController < PublicController def unblock if current_user.person.is_admin?(profile.environment) profile.unblock - session[:notice] = _("You have unblocked %s successfully. ") % profile.name + session[:notice] = _("You have unblocked %s successfully. ").html_safe % profile.name redirect_to :controller => 'profile', :action => 'index' else message = _('You are not allowed to unblock enterprises in this environment.') diff --git a/app/mailers/contact.rb b/app/mailers/contact.rb index 3eec193..c1804d2 100644 --- a/app/mailers/contact.rb +++ b/app/mailers/contact.rb @@ -47,7 +47,7 @@ class Contact content_type: 'text/html', to: contact.dest.notification_emails, reply_to: contact.email, - subject: "[#{contact.dest.short_name(30)}] #{contact.subject,}".html_safe, + subject: "[#{contact.dest.short_name(30)}] #{contact.subject}".html_safe, from: "#{contact.name} <#{contact.dest.environment.noreply_email}>".html_safe } diff --git a/app/models/abuse_complaint.rb b/app/models/abuse_complaint.rb index 8c8c3ab..ed3b280 100644 --- a/app/models/abuse_complaint.rb +++ b/app/models/abuse_complaint.rb @@ -25,7 +25,7 @@ class AbuseComplaint < Task end def title - abuse_reports.count > 1 ? (_('Abuse complaint (%s)') % abuse_reports.count) :_('Abuse complaint') + abuse_reports.count > 1 ? (_('Abuse complaint (%s)').html_safe % abuse_reports.count) :_('Abuse complaint') end def linked_subject @@ -57,15 +57,15 @@ class AbuseComplaint < Task end def task_activated_message - _('Your profile was reported by the users of %s due to inappropriate behavior. The administrators of the environment are now reviewing the report. To solve this misunderstanding, please contact the administrators.') % environment.name + _('Your profile was reported by the users of %s due to inappropriate behavior. The administrators of the environment are now reviewing the report. To solve this misunderstanding, please contact the administrators.').html_safe % environment.name end def task_finished_message - _('Your profile was disabled by the administrators of %s due to inappropriate behavior. To solve this misunderstanding please contact them.') % environment.name + _('Your profile was disabled by the administrators of %s due to inappropriate behavior. To solve this misunderstanding please contact them.').html_safe % environment.name end def target_notification_description - _('%s was reported due to inappropriate behavior.') % reported.name + _('%s was reported due to inappropriate behavior.').html_safe % reported.name end def target_notification_message diff --git a/app/views/account/activation_question.html.erb b/app/views/account/activation_question.html.erb index e0fd21f..b03b486 100644 --- a/app/views/account/activation_question.html.erb +++ b/app/views/account/activation_question.html.erb @@ -3,7 +3,7 @@ var answer = parseInt(form.answer.value); var val = form.answer.value; if (!answer || (val.length != 4) || val > <%= Time.now.year %> || val < 1900) { - alert(<%= (_('The year must be between %d and %d') % [1900, Time.now.year]).inspect %>); + alert(<%= (_('The year must be between %d and %d').html_safe % [1900, Time.now.year]).inspect %>); return false; } else { return true; @@ -28,9 +28,9 @@
<%= _('Pay atention! You have only one chance!') %>
-<%= _("This is a question to know if you really are part of this enterprise. Pay atention because you have only one chance to answer right and activate your enterprise. If you answer wrong you will not be able to activate the enterprise automaticaly and must get in touch with the admins of %s by email or phone.") % environment.name %>
+<%= _("This is a question to know if you really are part of this enterprise. Pay atention because you have only one chance to answer right and activate your enterprise. If you answer wrong you will not be able to activate the enterprise automaticaly and must get in touch with the admins of %s by email or phone.").html_safe % environment.name %>
- <%= ApplicationHelper::NoosferoFormBuilder::output_field(@question == :foundation_year ? (_("What year your enterprise was founded? It must have 4 digits, eg 1990. %s") % environment.tip_message_enterprise_activation_question) : _('What is the CNPJ of your enterprise?'), text_field_tag(:answer, nil, :id => 'enterprise-activation-answer')) %> + <%= ApplicationHelper::NoosferoFormBuilder::output_field(@question == :foundation_year ? (_("What year your enterprise was founded? It must have 4 digits, eg 1990. %s").html_safe % environment.tip_message_enterprise_activation_question) : _('What is the CNPJ of your enterprise?'), text_field_tag(:answer, nil, :id => 'enterprise-activation-answer')) %> <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %> diff --git a/app/views/admin_panel/_signup_welcome_text.html.erb b/app/views/admin_panel/_signup_welcome_text.html.erb index a81fa09..f1d6966 100644 --- a/app/views/admin_panel/_signup_welcome_text.html.erb +++ b/app/views/admin_panel/_signup_welcome_text.html.erb @@ -1,6 +1,6 @@-<%= _('Are you sure you want to add %s as your favorite enterprise?') % @favorite_enterprise.name %> +<%= _('Are you sure you want to add %s as your favorite enterprise?').html_safe % @favorite_enterprise.name %>
<%= form_tag do %> <%= hidden_field_tag(:confirmation, 1) %> - <%= submit_button(:ok, _("Yes, I am sure"), :title => _("I want to add %s as a favorite enterprise") % @favorite_enterprise.name) %> + <%= submit_button(:ok, _("Yes, I am sure"), :title => _("I want to add %s as a favorite enterprise").html_safe % @favorite_enterprise.name) %> <%= button(:cancel, _("No, I don't want"), :action => 'index') %> <% end %> diff --git a/app/views/friends/remove.html.erb b/app/views/friends/remove.html.erb index 1139b0b..e76b366 100644 --- a/app/views/friends/remove.html.erb +++ b/app/views/friends/remove.html.erb @@ -1,16 +1,16 @@-<%= _('Are you sure you want to remove %s from your friends list?') % @friend.name %> +<%= _('Are you sure you want to remove %s from your friends list?').html_safe % @friend.name %>
-<%= _('Note that %s will still have you as a friend, unless he/she also wants to remove you from his/her friend list.') % @friend.name %> +<%= _('Note that %s will still have you as a friend, unless he/she also wants to remove you from his/her friend list.').html_safe % @friend.name %>
diff --git a/app/views/home/welcome.html.erb b/app/views/home/welcome.html.erb index af66bff..716ed5e 100644 --- a/app/views/home/welcome.html.erb +++ b/app/views/home/welcome.html.erb @@ -1,7 +1,7 @@ <% default_message = defined?(default_message) ? default_message : false %><%= _("You won't appear as %s until your account is approved.").html_safe % link_to(_('user'), {:controller => :search, :action => :people, :filter => 'more_recent'}, :target => '_blank') %>
<% end %><%= _("Access your %s and see your face on the network!") % +
<%= _("Access your %s and see your face on the network!").html_safe % (user.present? ? link_to(_('Profile'), {:controller => 'profile', :profile => user.identifier}, :target => '_blank') : 'Profile') %> <%= _("You can also explore your %s to customize your profile. Here are some %s on what you can do there.").html_safe % [user.present? ? link_to(_('Control Panel'), {:controller => 'profile_editor', :profile => user.identifier}, :target => '_blank') : 'Control Panel', @@ -26,5 +26,5 @@
<%= _("Learn the guidelines. Read the %s for more details on how to use this social network!").html_safe % link_to(_('Documentation'), {:controller => 'doc'}, :target => '_blank') %>
<%= _("Start exploring and have fun!") %>
<% end %> - <%= render :partial => 'shared/template_welcome_page', :locals => {:template => @person_template, :header => _("What can I do as a %s?")} %> + <%= render :partial => 'shared/template_welcome_page', :locals => {:template => @person_template, :header => _("What can I do as a %s?").html_safe} %>-<%= _('Are you sure you want to remove %s from your suggestions list?') % suggestion.name %> +<%= _('Are you sure you want to remove %s from your suggestions list?').html_safe % suggestion.name %>
<%= form_tag do %> - <%= submit_button(:ok, _("Yes, I want to remove %s") % suggestion.name) %> + <%= submit_button(:ok, _("Yes, I want to remove %s").html_safe % suggestion.name) %> <%= button(:cancel, _("No"), :action => 'suggest') %> <% end %> diff --git a/app/views/tasks/ticket_details.html.erb b/app/views/tasks/ticket_details.html.erb index b384368..93cc07c 100644 --- a/app/views/tasks/ticket_details.html.erb +++ b/app/views/tasks/ticket_details.html.erb @@ -1,17 +1,17 @@ -
- <%= _('Created at %s by %s') % [@ticket.created_at.to_date, link_to(@ticket.requestor.name, @ticket.requestor.url)] %>
- <%= _('Owner: %s') % link_to(@ticket.target.name, @ticket.target.url) %>
+ <%= _('Created at %s by %s').html_safe % [@ticket.created_at.to_date, link_to(@ticket.requestor.name, @ticket.requestor.url)] %>
+ <%= _('Owner: %s').html_safe % link_to(@ticket.target.name, @ticket.target.url) %>
<%= _('Status: %s') % gettext(Task::Status.names[@ticket.status]) %>
+<%= _('Status: %s').html_safe % gettext(Task::Status.names[@ticket.status]) %>
<%= _('Description: %s') % @ticket.description %>
+<%= _('Description: %s').html_safe % @ticket.description %>
<%= _('Closing statement: %s') % @ticket.closing_statment %>
+<%= _('Closing statement: %s').html_safe % @ticket.closing_statment %>
<% end %> <%= button_bar do %> diff --git a/app/views/templates/index.html.erb b/app/views/templates/index.html.erb index 62ad1b7..719ca05 100644 --- a/app/views/templates/index.html.erb +++ b/app/views/templates/index.html.erb @@ -10,7 +10,7 @@ <% list_of_templates.each do |title, templates, kind|%><%= _('Template') %> | @@ -20,11 +20,11 @@|
---|---|
<%#= image_tag "icons-app/#{kind}-icon.png" %> - <%= link_to(template.name, {:controller => 'profile_editor', :profile => template.identifier}, :title => _('Edit template "%s"') % template.name ) %> + <%= link_to(template.name, {:controller => 'profile_editor', :profile => template.identifier}, :title => _('Edit template "%s"').html_safe % template.name ) %> <% if environment.is_default_template?(template) %> <%= _('is the default template') %> <% else %> - <%= link_to(_('Set as default'), {:action => "set_#{kind}_as_default", :template_id => template.id}, :title => _('Set %s template as default') % template.name ) %> + <%= link_to(_('Set as default'), {:action => "set_#{kind}_as_default", :template_id => template.id}, :title => _('Set %s template as default').html_safe % template.name ) %> <% end %> | diff --git a/app/views/user_mailer/activation_email_notify.text.erb b/app/views/user_mailer/activation_email_notify.text.erb index ff3a009..b115bfd 100644 --- a/app/views/user_mailer/activation_email_notify.text.erb +++ b/app/views/user_mailer/activation_email_notify.text.erb @@ -1,6 +1,6 @@ -<%= _('Hello %s,') % @name %> +<%= _('Hello %s,').html_safe % @name %> -<%= _('Your email %s was just activated.') % [@email] %> +<%= _('Your email %s was just activated.').html_safe % [@email] %> <%= _('You can access your e-mail from anywhere, using the following address:') %> <%= @webmail %> @@ -8,5 +8,5 @@ <%= _('Greetings,') %> -- -<%= _('%s team.') % @environment.name %> +<%= _('%s team.').html_safe % @environment.name %> <%= @url %> -- libgit2 0.21.2 |