Browse Source

I18n 'could not be saved'

Maarten van den Berg 7 years ago
parent
commit
161e7cbc90

+ 3 - 1
app/views/activities/_form.html.erb

@@ -1,7 +1,9 @@
1 1
 <%= form_for([@group, activity]) do |f| %>
2 2
   <% if activity.errors.any? %>
3 3
     <div id="error_explanation">
4
-      <h2><%= pluralize(activity.errors.count, "error") %> prohibited this activity from being saved:</h2>
4
+      <h2>
5
+        <%= I18n.t(:could_not_be_saved, errorcount: I18n.t(:error, count: activity.errors.count), class: I18n.t('activities.singular')) %>
6
+      </h2>
5 7
 
6 8
       <ul>
7 9
       <% activity.errors.full_messages.each do |message| %>

+ 7 - 0
config/locales/aardbei_en.yml

@@ -46,6 +46,13 @@ en:
46 46
 
47 47
   invalid_csrf: "You submitted an invalid request! If you got here after clicking a link, it's possible that someone is doing something nasty!"
48 48
 
49
+  could_not_be_saved: "%{errorcount} prevented this %{class} from being saved:"
50
+
51
+  error:
52
+    zero: "no errors"
53
+    one: "an error"
54
+    other: "%{count} errors"
55
+
49 56
   activerecord:
50 57
     models:
51 58
       person:

+ 7 - 0
config/locales/aardbei_nl.yml

@@ -24,3 +24,10 @@ nl:
24 24
   value_required: "Een verplichte vraag was leeg."
25 25
 
26 26
   invalid_csrf: "Ongeldig authenticiteitstoken! Als je hier terecht bent gekomen na het klikken op een link is het mogelijk dat iemand iets naars probeerde!"
27
+
28
+  could_not_be_saved: "Door %{errorcount} kon deze %{class} niet worden opgeslagen:"
29
+
30
+  error:
31
+    zero: "geen fouten"
32
+    one: "een fout"
33
+    other: "%{count} fouten"