Skip to content

Commit c0f6981

Browse files
committed
Enable translations with gettext method
NOTE: For app/views/org_admin/conditions/_existing_condition_display.erb, `hook_tip` refers to the pop up message that is rendered when hovering over the email address in the "Target" section of an "Email" type action. We are only enabling for the titles here ('Name', 'Email', 'Subject', and 'Message'), not the actual corresponding values.
1 parent 478fdad commit c0f6981

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<div class="row">
22
<div class="col-md-12 mt-2">
33
<%= link_to _('Add condition'), new_org_admin_question_condition_path(question_id: question.id, condition_no: condition_no), remote: true, class: "add-condition" %>
4-
<p>To add a condition you must have selected an Option and Action together with
4+
<p>
5+
<%= _('To add a condition you must have selected an Option and Action together with') %>
56
<ul>
6-
<li>if Action is 'remove', you need to select one or more choices in Target.</li>
7-
<li>if Action is 'add notification', you need to fill in all the fields in the 'Send email' popup.</li>
7+
<li> <%= _("if Action is 'remove', you need to select one or more choices in Target.") %> </li>
8+
<li> <%= _("if Action is 'add notification', you need to fill in all the fields in the 'Send email' popup.") %> </li>
89
</ul>
9-
Otherwise, the condition will not be saved.
10+
<%= _('Otherwise, the condition will not be saved.') %>
1011
</p>
1112
</div>
1213
</div>

app/views/org_admin/conditions/_existing_condition_display.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<%= hidden_field_tag(name_start + "[question_option][]", condition[:question_option_id]) %>
99
</div>
1010
<div class="col-md-3 pe-2">
11-
<%= condition[:action_type] == 'remove' ? 'Remove' : 'Email' %>
11+
<%= condition[:action_type] == 'remove' ? _('Remove') : _('Email') %>
1212
<%= hidden_field_tag(name_start + "[action_type]", condition[:action_type]) %>
1313
</div>
1414
<div class="col-md-3 pe-2">
@@ -21,8 +21,10 @@
2121
<%= hidden_field_tag(name_start + "[remove_question_id][]", condition[:remove_question_id]) %>
2222
<% else %>
2323
<%
24-
hook_tip = "Name: #{condition[:webhook_data]['name']}\nEmail: #{condition[:webhook_data]['email']}\n"
25-
hook_tip += "Subject: #{condition[:webhook_data]['subject']}\nMessage: #{condition[:webhook_data]['message']}"
24+
hook_tip = "#{_('Name')}: #{condition[:webhook_data]['name']}\n"
25+
hook_tip += "#{_('Email')}: #{condition[:webhook_data]['email']}\n"
26+
hook_tip += "#{_('Subject')}: #{condition[:webhook_data]['subject']}\n"
27+
hook_tip += "#{_('Message')}: #{condition[:webhook_data]['message']}"
2628
%>
2729
<span title="<%= hook_tip %>"><%= condition[:webhook_data]['email'] %></span>
2830
<br>(<%= view_email_content_info %>)

app/views/org_admin/conditions/_new_condition_form.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
remove_question_group = grouped_options_for_select(remove_question_collection)
55
%>
66

7-
<div class="form-label bold">Add condition</div>
7+
<div class="form-label bold"> <%= _('Add condition') %> </div>
88
<div class="row mb-3">
99
<div class="col-md-9 pe-2">
1010
<div class="form-label bold"><%= _('Option') %></div>

0 commit comments

Comments
 (0)