ソースを参照

More i18n in activities

Maarten van den Berg 7 年 前
コミット
757da1b2f6

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

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

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

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

+ 8 - 0
config/locales/en.yml

26
 
26
 
27
   log_out: Log out
27
   log_out: Log out
28
   log_in: Log in
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
 nl:
1
 nl:
2
   hello: "Hallo wereld"
2
   hello: "Hallo wereld"
3
+
3
   collapse: "Inklappen"
4
   collapse: "Inklappen"
4
 
5
 
5
   log_out: Uitloggen
6
   log_out: Uitloggen
6
   log_in: Inloggen
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?