Skip to content

Commit

Permalink
fixed issue with args in translatable:find (#1963)
Browse files Browse the repository at this point in the history
fixed issue with translatable text having a newline between the closing quote and the closing paren

fixed issues with translatable text in planscsv export and sharing notification

fixed issue with translatable on templates controller

fixed issue with multiline strings in translatable:find

fixed issue with multiline strings in translatable:find

cleaned up en-US translations
  • Loading branch information
briri authored and xsrust committed Oct 23, 2018
1 parent ad811b0 commit f0d0659
Show file tree
Hide file tree
Showing 12 changed files with 2,540 additions and 1,108 deletions.
3 changes: 1 addition & 2 deletions app/controllers/org_admin/plans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def feedback_complete
# rubocop:enable LineLength
else
redirect_to org_admin_plans_path,
alert: _("Unable to notify user that you have finished providing feedback."
)
alert: _("Unable to notify user that you have finished providing feedback.")
end
end

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/org_admin/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def update
rescue ActiveSupport::JSON.parse_error
render(json: {
status: :bad_request,
msg: _("Error parsing links for a #{template_type(template)}")
msg: _("Error parsing links for a %{template}") %
{ template: template_type(template) }
})
return
rescue => e
Expand Down
15 changes: 8 additions & 7 deletions app/models/concerns/exportable_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,21 @@ def prepare_coversheet
def prepare_coversheet_for_csv(csv, headings, hash)
csv << [ hash[:attribution].many? ?
_("Creators: ") :
_("Creator:"), _(hash[:attribution].join(", ")) ]
csv << [ "Affiliation: ", _(hash[:affiliation]) ]
_("Creator:"), _("%{authors}") % { authors: hash[:attribution].join(", ") } ]
csv << [ "Affiliation: ", _("%{affiliation}") % { affiliation: hash[:affiliation] } ]
if hash[:funder].present?
csv << [ _("Template: "), _(hash[:funder]) ]
csv << [ _("Template: "), _("%{funder}") % { funder: hash[:funder] } ]
else
csv << [ _("Template: "), _(hash[:template] + hash[:customizer]) ]
csv << [ _("Template: "), _("%{template}") % { template: hash[:template] + hash[:customizer] } ]
end
if self.grant_number.present?
csv << [ _("Grant number: "), _(self.grant_number) ]
csv << [ _("Grant number: "), _("%{grant_number}") % { grant_number: self.grant_number } ]
end
if self.description.present?
csv << [ _("Project abstract: "), _(Nokogiri::HTML(self.description).text) ]
csv << [ _("Project abstract: "), _("%{description}") %
{ description: Nokogiri::HTML(self.description).text } ]
end
csv << [ _("Last modified: "), _(self.updated_at.to_date.strftime("%d-%m-%Y")) ]
csv << [ _("Last modified: "), _("%{date}") % { date: self.updated_at.to_date.strftime("%d-%m-%Y") } ]
csv << [ _("Copyright information:"),
_("The above plan creator(s) have agreed that others may use as
much of the text of this plan as they would like in their own plans,
Expand Down
4 changes: 2 additions & 2 deletions app/views/user_mailer/sharing_notification.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<%= _('Hello %{user_email}') %{ :user_email => user_email } %>
</p>
<p>
<%= _("Your colleague %{inviter_name} has invited you to contribute to "\
" their Data Management Plan in %{tool_name}") % {
<%= _("Your colleague %{inviter_name} has invited you to contribute to
their Data Management Plan in %{tool_name}") % {
tool_name: tool_name,
inviter_name: @inviter.name(false)
} %>
Expand Down
Loading

0 comments on commit f0d0659

Please sign in to comment.