Skip to content

Commit f0d0659

Browse files
bririxsrust
authored andcommitted
fixed issue with args in translatable:find (#1963)
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
1 parent ad811b0 commit f0d0659

File tree

12 files changed

+2540
-1108
lines changed

12 files changed

+2540
-1108
lines changed

app/controllers/org_admin/plans_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def feedback_complete
3939
# rubocop:enable LineLength
4040
else
4141
redirect_to org_admin_plans_path,
42-
alert: _("Unable to notify user that you have finished providing feedback."
43-
)
42+
alert: _("Unable to notify user that you have finished providing feedback.")
4443
end
4544
end
4645

app/controllers/org_admin/templates_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ def update
192192
rescue ActiveSupport::JSON.parse_error
193193
render(json: {
194194
status: :bad_request,
195-
msg: _("Error parsing links for a #{template_type(template)}")
195+
msg: _("Error parsing links for a %{template}") %
196+
{ template: template_type(template) }
196197
})
197198
return
198199
rescue => e

app/models/concerns/exportable_plan.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,21 @@ def prepare_coversheet
117117
def prepare_coversheet_for_csv(csv, headings, hash)
118118
csv << [ hash[:attribution].many? ?
119119
_("Creators: ") :
120-
_("Creator:"), _(hash[:attribution].join(", ")) ]
121-
csv << [ "Affiliation: ", _(hash[:affiliation]) ]
120+
_("Creator:"), _("%{authors}") % { authors: hash[:attribution].join(", ") } ]
121+
csv << [ "Affiliation: ", _("%{affiliation}") % { affiliation: hash[:affiliation] } ]
122122
if hash[:funder].present?
123-
csv << [ _("Template: "), _(hash[:funder]) ]
123+
csv << [ _("Template: "), _("%{funder}") % { funder: hash[:funder] } ]
124124
else
125-
csv << [ _("Template: "), _(hash[:template] + hash[:customizer]) ]
125+
csv << [ _("Template: "), _("%{template}") % { template: hash[:template] + hash[:customizer] } ]
126126
end
127127
if self.grant_number.present?
128-
csv << [ _("Grant number: "), _(self.grant_number) ]
128+
csv << [ _("Grant number: "), _("%{grant_number}") % { grant_number: self.grant_number } ]
129129
end
130130
if self.description.present?
131-
csv << [ _("Project abstract: "), _(Nokogiri::HTML(self.description).text) ]
131+
csv << [ _("Project abstract: "), _("%{description}") %
132+
{ description: Nokogiri::HTML(self.description).text } ]
132133
end
133-
csv << [ _("Last modified: "), _(self.updated_at.to_date.strftime("%d-%m-%Y")) ]
134+
csv << [ _("Last modified: "), _("%{date}") % { date: self.updated_at.to_date.strftime("%d-%m-%Y") } ]
134135
csv << [ _("Copyright information:"),
135136
_("The above plan creator(s) have agreed that others may use as
136137
much of the text of this plan as they would like in their own plans,

app/views/user_mailer/sharing_notification.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<%= _('Hello %{user_email}') %{ :user_email => user_email } %>
99
</p>
1010
<p>
11-
<%= _("Your colleague %{inviter_name} has invited you to contribute to "\
12-
" their Data Management Plan in %{tool_name}") % {
11+
<%= _("Your colleague %{inviter_name} has invited you to contribute to
12+
their Data Management Plan in %{tool_name}") % {
1313
tool_name: tool_name,
1414
inviter_name: @inviter.name(false)
1515
} %>

0 commit comments

Comments
 (0)