Skip to content

Commit b610709

Browse files
committed
I18n for submit buttons
1 parent b9047b2 commit b610709

10 files changed

Lines changed: 29 additions & 12 deletions

File tree

app/views/collections/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
group_by: 'group', transform_function: 'events' } %>
2525

2626
<div class="form-group actions">
27-
<%= f.submit ( f.object.new_record? ? "Create" : "Update") + " collection", :class => 'btn btn-primary' %>
27+
<%= f.submit(class: 'btn btn-primary') %>
2828
<%= link_to 'Back', collections_path, class: 'btn btn-default' %>
2929
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
3030
collections_path, :class => 'btn btn-default' %>

app/views/content_providers/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<% end %>
4343

4444
<div class="form-group">
45-
<%= f.submit (f.object.new_record? ? "Register" : "Update") + " content provider", class: 'btn btn-primary' %>
45+
<%= f.submit(class: 'btn btn-primary') %>
4646
<%= link_to 'Back', content_providers_path, class: 'btn btn-default' %>
4747
<%= link_to t('.cancel', default: t("helpers.links.cancel")),
4848
content_providers_path, class: 'btn btn-default' %>

app/views/events/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
<% end %>
169169

170170
<div class="form-group">
171-
<%= f.submit (f.object.new_record? ? "Add" : "Update") + " event", :class => 'btn btn-primary' %>
171+
<%= f.submit(class: 'btn btn-primary') %>
172172
<%= link_to 'Back', :back, class: 'btn btn-default' %>
173173
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
174174
:back, :class => 'btn btn-default' %>

app/views/learning_path_topics/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
group_by: 'group', transform_function: 'events' } %>
2727

2828
<div class="form-group actions">
29-
<%= f.submit ( f.object.new_record? ? "Create" : "Update") + " topic", class: 'btn btn-primary' %>
29+
<%= f.submit(class: 'btn btn-primary') %>
3030
<%= link_to 'Back', collections_path, class: 'btn btn-default' %>
3131
<%= link_to t('.cancel', default: t("helpers.links.cancel")),
3232
collections_path, class: 'btn btn-default' %>

app/views/learning_paths/_form.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124

125125
<!-- Form Buttons -->
126126
<div class="form-group">
127-
<%= f.submit (f.object.new_record? ? "Register" : "Update") + " learning path", :class => 'btn btn-primary mr-2' %>
128-
<%= link_to 'Back', :back, class: "btn btn-default mr-2" %>
127+
<%= f.submit(class: 'btn btn-primary') %>
128+
<%= link_to 'Back', :back, class: "btn btn-default" %>
129129
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
130130
learning_paths_path, :class => 'btn btn-default' %>
131131
</div>

app/views/materials/_form.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@
183183
<hr>
184184
<!-- Form Buttons -->
185185
<div class="form-group">
186-
<%= f.submit (f.object.new_record? ? "Register" : "Update") + " training material", :class => 'btn btn-primary mr-2' %>
187-
<%= link_to 'Back', :back, class: "btn btn-default mr-2" %>
186+
<%= f.submit(class: 'btn btn-primary') %>
187+
<%= link_to 'Back', :back, class: "btn btn-default" %>
188188
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
189189
materials_path, :class => 'btn btn-default' %>
190190
</div>

app/views/nodes/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</div>
3131

3232
<div class="form-group">
33-
<%= f.submit ( f.object.new_record? ? "Register" : "Update") + " node", :class => 'btn btn-primary' %>
33+
<%= f.submit(class: 'btn btn-primary') %>
3434
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
3535
@node.new_record? ? nodes_path : node_path(@node), :class => 'btn btn-default' %>
3636
</div>

app/views/sources/_form.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
<% end %>
3838

3939
<div class="form-group actions">
40-
<%= f.submit (f.object.new_record? ? "Create" : "Update") + " source",
41-
class: 'btn btn-primary' %>
40+
<%= f.submit(class: 'btn btn-primary') %>
4241
<%= link_to t('.cancel', default: t("helpers.links.cancel")),
4342
sources_path, class: 'btn btn-default' %>
4443
</div>

app/views/spaces/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
existing_items_method: :administrators %>
2121

2222
<div class="form-group">
23-
<%= f.submit ( f.object.new_record? ? "Register" : "Update") + " space", class: 'btn btn-primary' %>
23+
<%= f.submit(class: 'btn btn-primary') %>
2424
<%= link_to t('.cancel', default: t("helpers.links.cancel")),
2525
@space.new_record? ? spaces_path : space_path(@space), class: 'btn btn-default' %>
2626
</div>

config/locales/en.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ en:
5454
trainer: Trainer
5555
content_provider: Content Provider
5656
node: Node
57+
learning_path_topic: Topic
5758
attributes:
5859
content_provider:
5960
user: Owner
@@ -983,3 +984,20 @@ en:
983984
check_broken_scrapers: Receive emails with scrapers that have not found anything last period.
984985
profile:
985986
language: Languages Spoken
987+
988+
helpers:
989+
submit:
990+
create: Register %{model}
991+
update: Update %{model}
992+
collection:
993+
create: Create %{model}
994+
update: Update %{model}
995+
workflow:
996+
create: Create %{model}
997+
update: Update %{model}
998+
learning_path:
999+
create: Create %{model}
1000+
update: Update %{model}
1001+
learning_path_topic:
1002+
create: Create %{model}
1003+
update: Update %{model}

0 commit comments

Comments
 (0)