Browse Source

More i18n in activities

Maarten van den Berg 7 years ago
parent
commit
757da1b2f6

+ 5 - 3
app/views/activities/edit.html.erb

@@ -1,6 +1,8 @@
1
-<h1>Editing Activity</h1>
1
+<h1>
2
+  <%= t 'activity.editing' %>
3
+</h1>
2 4
 
3 5
 <%= render 'form', activity: @activity %>
4 6
 
5
-<%= link_to 'Show', group_activity_path(@group, @activity) %> |
6
-<%= link_to 'Back', group_activities_path(@group) %>
7
+<%= link_to t(:cancel), group_activity_path(@group, @activity) %> |
8
+<%= link_to t(:back), group_activities_path(@group) %>

+ 4 - 4
app/views/activities/index.html.erb

@@ -10,9 +10,9 @@
10 10
   <tbody>
11 11
     <% @activities.each do |activity| %>
12 12
       <tr>
13
-        <td><%= link_to 'Show', group_activity_path(@group, activity) %></td>
14
-        <td><%= link_to 'Edit', edit_group_activity_path(@group, activity) %></td>
15
-        <td><%= link_to 'Destroy', group_activity_path(@group, activity), method: :delete, data: { confirm: 'Are you sure?' } %></td>
13
+        <td><%= link_to t(:show), group_activity_path(@group, activity) %></td>
14
+        <td><%= link_to t(:edit), edit_group_activity_path(@group, activity) %></td>
15
+        <td><%= link_to t(:destroy), group_activity_path(@group, activity), method: :delete, data: { confirm: t(:areyousure) } %></td>
16 16
       </tr>
17 17
     <% end %>
18 18
   </tbody>
@@ -20,4 +20,4 @@
20 20
 
21 21
 <br>
22 22
 
23
-<%= link_to 'New Activity', new_group_activity_path(@group) %>
23
+<%= link_to t('activities.new'), new_group_activity_path(@group) %>

+ 2 - 2
app/views/activities/new.html.erb

@@ -1,5 +1,5 @@
1
-<h1>New Activity</h1>
1
+<h1><%= t('activities.new') %></h1>
2 2
 
3 3
 <%= render 'form', activity: @activity %>
4 4
 
5
-<%= link_to 'Back', group_activities_path(@group) %>
5
+<%= link_to t(:back), group_activities_path(@group) %>

+ 20 - 28
app/views/activities/show.html.haml

@@ -11,24 +11,24 @@
11 11
       %table.table
12 12
         %tr
13 13
           %td
14
-            Organizers:
14
+            = t 'activities.attrs.organizers'
15 15
           %td
16 16
             = @organizers
17 17
         %tr
18 18
           %td
19
-            Description:
19
+            = t 'activities.attrs.description'
20 20
           %td
21 21
             = @activity.description
22 22
 
23 23
         %tr
24 24
           %td
25
-            Location:
25
+            = t 'activities.attrs.location'
26 26
           %td
27 27
             = @activity.location
28 28
 
29 29
         %tr
30 30
           %td
31
-            When:
31
+            = t 'activities.attrs.when'
32 32
 
33 33
           %td
34 34
             = @activity.start
@@ -37,7 +37,7 @@
37 37
 
38 38
         %tr
39 39
           %td
40
-            Deadline:
40
+            = t 'activities.attrs.deadline'
41 41
 
42 42
           %td
43 43
             = @activity.deadline
@@ -46,30 +46,21 @@
46 46
     .col-md-3
47 47
       .panel.panel-default
48 48
         .panel-heading
49
-          Your response
49
+          = t 'activities.participant.yourresponse'
50 50
         .panel-body
51 51
           = render partial: "activities/wide_presence_buttons", locals: {activity: @activity, person: @ownparticipant.person, state: @ownparticipant.attending}
52 52
 
53
-          -#.btn-group.btn-group-justified
54
-            -#.btn-group
55
-              -#%button.btn.btn-success
56
-                -#Present
57
-
58
-            -#.btn-group
59
-              -#%button.btn.btn-danger
60
-                -#Absent
61
-
62 53
           = editable @ownparticipant,
63 54
             :notes,
64 55
             url: presence_group_activity_path(@activity.group, @activity, person_id: @ownparticipant.person_id),
65
-            title: "Notes",
56
+            title: t('activities.participant.notes'),
66 57
             value: "",
67
-            emptytext: "Add notes..."
58
+            emptytext: t('activities.participant.add_notes')
68 59
 
69 60
 .hidden-xs
70 61
   %h2
71 62
     = @num_participants
72
-    participants
63
+    = t 'activities.participant.plural'
73 64
     = render partial: "state_counts", locals: {counts: @counts}
74 65
 
75 66
   %table.table.table-bordered
@@ -81,7 +72,7 @@
81 72
             %i.fa.fa-star-o
82 73
 
83 74
         %td
84
-          = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: "Notes", value: p.notes, emptytext: "--"
75
+          = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"
85 76
 
86 77
         %td
87 78
           = render partial: "activities/presence_buttons", locals: {activity: @activity, person: p.person, state: p.attending}
@@ -89,9 +80,6 @@
89 80
 .hidden-sm.hidden-md.hidden-lg
90 81
   .panel.panel-default.panel-success
91 82
     .panel-heading
92
-      -#%button.btn.btn-default.btn-sm{data: {toggle: 'collapse', target: '#present-collapse'}}
93
-        -#%i.fa.fa-arrows-v
94
-
95 83
       %a{role: 'button', href: '#present-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
96 84
 
97 85
         %span.sv-show-collapsed
@@ -100,7 +88,7 @@
100 88
         %span.sv-show-expanded
101 89
           %i.fa.fa-angle-up
102 90
 
103
-        Present
91
+        = t 'activities.state.present'
104 92
         %span.badge
105 93
           = @counts[true]
106 94
 
@@ -118,7 +106,7 @@
118 106
 
119 107
           %tr{data: {person_id: p.person_id, activity_id: @activity.id}}
120 108
             %td{colspan: "2"}
121
-              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: "Notes", value: p.notes, emptytext: "--"
109
+              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"
122 110
 
123 111
 
124 112
   .panel.panel-default
@@ -130,7 +118,9 @@
130 118
 
131 119
         %span.sv-show-expanded
132 120
           %i.fa.fa-angle-up
133
-        No reaction
121
+
122
+        = t 'activities.state.need_response'
123
+
134 124
         %span.badge
135 125
           = @counts[nil]
136 126
 
@@ -148,7 +138,7 @@
148 138
 
149 139
           %tr{data: {person_id: p.person_id, activity_id: @activity.id}}
150 140
             %td{colspan: "2"}
151
-              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: "Notes", value: p.notes, emptytext: "--"
141
+              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activitites.participant.notes'), value: p.notes, emptytext: "--"
152 142
 
153 143
   .panel.panel-default.panel-danger
154 144
     .panel-heading
@@ -159,7 +149,9 @@
159 149
 
160 150
         %span.sv-show-expanded
161 151
           %i.fa.fa-angle-up
162
-        Absent
152
+
153
+        = t 'activities.state.absent'
154
+
163 155
         %span.badge
164 156
           = @counts[false]
165 157
 
@@ -177,4 +169,4 @@
177 169
 
178 170
           %tr{data: {person_id: p.person_id, activity_id: @activity.id}}
179 171
             %td{colspan: "2"}
180
-              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: "Notes", value: p.notes, emptytext: "--"
172
+              = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activitites.participant.notes'), value: p.notes, emptytext: "--"

+ 8 - 0
config/locales/activities/en.yml

@@ -3,9 +3,14 @@ en:
3 3
     singular: Activity
4 4
     plural: Activities
5 5
 
6
+    new: Nieuwe activiteit
7
+
6 8
     participant:
9
+      singular: participant
10
+      plural: participants
7 11
       notes: Notes
8 12
       add_notes: Add notes
13
+      yourresponse: Your response
9 14
 
10 15
     state:
11 16
       need_response: Need response
@@ -19,3 +24,6 @@ en:
19 24
       when: When
20 25
       where: Where
21 26
       actions: Actions
27
+      organizers: Organizers
28
+      description: Description
29
+      deadline: Deadline

+ 8 - 0
config/locales/activities/nl.yml

@@ -3,9 +3,14 @@ nl:
3 3
     singular: Activiteit
4 4
     plural: Activiteiten
5 5
 
6
+    new: New activity
7
+
6 8
     participant:
9
+      singular: deelnemer
10
+      plural: deelnemers
7 11
       notes: Opmerkingen
8 12
       add_notes: Opmerkingen toevoegen
13
+      yourresponse: Jouw antwoord
9 14
 
10 15
     state:
11 16
       need_response: Niet gereageerd
@@ -19,3 +24,6 @@ nl:
19 24
       when: Wanneer
20 25
       where: Waar
21 26
       actions: Acties
27
+      organizers: Organisatoren
28
+      description: Omschrijving
29
+      deadline: Deadline

+ 8 - 0
config/locales/en.yml

@@ -26,3 +26,11 @@ en:
26 26
 
27 27
   log_out: Log out
28 28
   log_in: Log in
29
+
30
+  cancel: Cancel
31
+  back: Back
32
+  show: Show
33
+  edit: Edit
34
+  destroy: Delete
35
+
36
+  areyousure: Are you sure?

+ 9 - 0
config/locales/nl.yml

@@ -1,6 +1,15 @@
1 1
 nl:
2 2
   hello: "Hallo wereld"
3
+
3 4
   collapse: "Inklappen"
4 5
 
5 6
   log_out: Uitloggen
6 7
   log_in: Inloggen
8
+
9
+  cancel: Annuleren
10
+  back: Terug
11
+  show: Weergeven
12
+  edit: Bewerken
13
+  destroy: Verwijderen
14
+
15
+  areyousure: Weet je het zeker?