Browse Source

Begin i18n

Maarten van den Berg 7 years ago
parent
commit
54606b0a40

+ 13 - 13
app/views/dashboard/home.html.haml

4
       .col-md-12
4
       .col-md-12
5
         .panel.panel-default
5
         .panel.panel-default
6
           .panel-heading
6
           .panel-heading
7
-            Need response
7
+            = t 'activities.state.need_response'
8
 
8
 
9
           .panel-body
9
           .panel-body
10
             %table.table.table-bordered
10
             %table.table.table-bordered
11
               %thead
11
               %thead
12
                 %tr
12
                 %tr
13
                   %th
13
                   %th
14
-                    Name
14
+                    = t 'activities.attrs.name'
15
                   %th
15
                   %th
16
-                    Group
16
+                    = t 'activities.attrs.group'
17
                   %th
17
                   %th
18
-                    When
18
+                    = t 'activities.attrs.when'
19
                   %th
19
                   %th
20
-                    Where
20
+                    = t 'activities.attrs.where'
21
                   %th
21
                   %th
22
-                    Actions
22
+                    = t 'activities.attrs.actions'
23
 
23
 
24
               %tbody
24
               %tbody
25
                 - @need_response.each do |p|
25
                 - @need_response.each do |p|
26
                   - e = p.activity
26
                   - e = p.activity
27
                   %tr{class: p.row_class, data: {activity_id: e.id, person_id: current_person.id}}
27
                   %tr{class: p.row_class, data: {activity_id: e.id, person_id: current_person.id}}
28
                     %td
28
                     %td
29
-                      = e.public_name
29
+                      = e.name
30
                     %td
30
                     %td
31
                       = e.group.name
31
                       = e.group.name
32
                     %td
32
                     %td
39
     .col-md-6
39
     .col-md-6
40
       .panel.panel-default
40
       .panel.panel-default
41
         .panel-heading
41
         .panel-heading
42
-          Groups
42
+          = t 'groups.singular'
43
 
43
 
44
         .panel-body
44
         .panel-body
45
           %table.table.table-bordered
45
           %table.table.table-bordered
53
     .col-md-6
53
     .col-md-6
54
       .panel.panel-default
54
       .panel.panel-default
55
         .panel-heading
55
         .panel-heading
56
-          Organized by you
56
+          = t 'dashboard.organized_you'
57
 
57
 
58
         .panel-body
58
         .panel-body
59
           %table.table.table-striped.table-bordered
59
           %table.table.table-striped.table-bordered
63
                 %tr
63
                 %tr
64
                   %td
64
                   %td
65
                     = link_to group_activity_url(a.group, a) do
65
                     = link_to group_activity_url(a.group, a) do
66
-                      = a.public_name
66
+                      = a.name
67
                       = render partial: "activities/state_counts", locals: {counts: a.state_counts}
67
                       = render partial: "activities/state_counts", locals: {counts: a.state_counts}
68
 
68
 
69
   .row
69
   .row
70
     .col-md-12
70
     .col-md-12
71
       .panel.panel-default
71
       .panel.panel-default
72
         .panel-heading
72
         .panel-heading
73
-          Your activities
73
+          = t 'dashboard.participant_you'
74
 
74
 
75
         .panel-body
75
         .panel-body
76
           %table.table.table-striped
76
           %table.table.table-striped
79
                 - e = p.activity
79
                 - e = p.activity
80
                 %tr{class: p.row_class, data: {activity_id: e.id, person_id: current_person.id}}
80
                 %tr{class: p.row_class, data: {activity_id: e.id, person_id: current_person.id}}
81
                   %td
81
                   %td
82
-                    = e.public_name
82
+                    = e.name
83
                   %td
83
                   %td
84
                     = render partial: "activities/presence_buttons", locals: {activity: e, person: current_person, state: p.attending}
84
                     = render partial: "activities/presence_buttons", locals: {activity: e, person: current_person, state: p.attending}
85
                   %td
85
                   %td
86
-                    = editable p, :notes, url: presence_group_activity_path(e.group, e, person_id: current_person.id), title: "Notes", value: p.notes, emptytext: 'Notes'
86
+                    = editable p, :notes, url: presence_group_activity_path(e.group, e, person_id: current_person.id), title: t('activities.participant.notes'), value: p.notes, emptytext: t('activities.participant.add_notes')

+ 5 - 5
app/views/shared/_menu.html.haml

3
     .navbar-header
3
     .navbar-header
4
       %button.navbar-toggle.collapsed{type: 'button', data: {toggle: 'collapse', target: '#navbar'}, 'aria-expanded': false, 'aria-controls': 'navbar'}
4
       %button.navbar-toggle.collapsed{type: 'button', data: {toggle: 'collapse', target: '#navbar'}, 'aria-expanded': false, 'aria-controls': 'navbar'}
5
         .sr-only
5
         .sr-only
6
-          inklappen enzo
6
+          = t 'collapse'
7
         .icon-bar
7
         .icon-bar
8
         .icon-bar
8
         .icon-bar
9
         .icon-bar
9
         .icon-bar
20
         %li
20
         %li
21
           = link_to user_groups_path do
21
           = link_to user_groups_path do
22
             %i.fa.fa-users{'aria-hidden': true}
22
             %i.fa.fa-users{'aria-hidden': true}
23
-            Groups
23
+            = t 'groups.plural'
24
 
24
 
25
         - if current_person.is_admin?
25
         - if current_person.is_admin?
26
           %li
26
           %li
27
             = link_to people_path do
27
             = link_to people_path do
28
               %i.fa.fa-user{'aria-hidden': true}
28
               %i.fa.fa-user{'aria-hidden': true}
29
-              People
29
+              = t 'person.plural'
30
 
30
 
31
           %li
31
           %li
32
             = link_to groups_path do
32
             = link_to groups_path do
33
               %i.fa.fa-users{'aria-hidden': true}
33
               %i.fa.fa-users{'aria-hidden': true}
34
-              All groups
34
+              = t 'groups.all'
35
 
35
 
36
       %ul.nav.navbar-nav.navbar-right
36
       %ul.nav.navbar-nav.navbar-right
37
         %li
37
         %li
40
         %li
40
         %li
41
           = link_to logout_path, confirm: "Really log out?", method: :delete do
41
           = link_to logout_path, confirm: "Really log out?", method: :delete do
42
             %i.fa.fa-sign-out{'aria-hidden': true}
42
             %i.fa.fa-sign-out{'aria-hidden': true}
43
-            Log out
43
+            = t 'log_out'

+ 3 - 0
config/application.rb

14
     default_url_options[:host] = ENV['AARDBEI_HOSTNAME']
14
     default_url_options[:host] = ENV['AARDBEI_HOSTNAME']
15
 
15
 
16
     config.time_zone = 'Amsterdam'
16
     config.time_zone = 'Amsterdam'
17
+
18
+    config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
19
+    config.i18n.default_locale = :nl
17
   end
20
   end
18
 end
21
 end

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

1
+en:
2
+  activities:
3
+    singular: Activity
4
+    plural: Activities
5
+
6
+    participant:
7
+      notes: Notes
8
+      add_notes: Add notes
9
+
10
+    state:
11
+      need_response: Need response
12
+      present: Present
13
+      absent: Absent
14
+      unknown: Unknown
15
+
16
+    attrs:
17
+      name: Name
18
+      group: Group
19
+      when: When
20
+      where: Where
21
+      actions: Actions

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

1
+nl:
2
+  activities:
3
+    singular: Activiteit
4
+    plural: Activiteiten
5
+
6
+    participant:
7
+      notes: Opmerkingen
8
+      add_notes: Opmerkingen toevoegen
9
+
10
+    state:
11
+      need_response: Niet gereageerd
12
+      present: Aanwezig
13
+      absent: Afwezig
14
+      unknown: Onbekend
15
+
16
+    attrs:
17
+      name: Naam
18
+      group: Groep
19
+      when: Wanneer
20
+      where: Waar
21
+      actions: Acties

+ 4 - 0
config/locales/dashboard/en.yml

1
+en:
2
+  dashboard:
3
+    participant_you: Your activities
4
+    organized_you: Organized by you

+ 4 - 0
config/locales/dashboard/nl.yml

1
+nl:
2
+  dashboard:
3
+    participant_you: Jouw activiteiten
4
+    organized_you: Georganiseerd door jou

+ 5 - 0
config/locales/en.yml

21
 
21
 
22
 en:
22
 en:
23
   hello: "Hello world"
23
   hello: "Hello world"
24
+
25
+  collapse: Collapse
26
+
27
+  log_out: Log out
28
+  log_in: Log in

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

1
+en:
2
+  groups:
3
+    singular: Group
4
+    plural: Groups
5
+    all: All Groups
6
+
7
+    attrs:
8
+      name: Name

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

1
+nl:
2
+  groups:
3
+    singular: Groep
4
+    plural: Groepen
5
+    all: Alle Groepen
6
+
7
+    attrs:
8
+      name: Naam

+ 6 - 0
config/locales/nl.yml

1
+nl:
2
+  hello: "Hallo wereld"
3
+  collapse: "Inklappen"
4
+
5
+  log_out: Uitloggen
6
+  log_in: Inloggen

+ 5 - 0
config/locales/person/en.yml

1
+en:
2
+  person:
3
+    singular: Person
4
+    plural: People
5
+    all: All persons

+ 5 - 0
config/locales/person/nl.yml

1
+nl:
2
+  person:
3
+    singular: Persoon
4
+    plural: Personen
5
+    all: Alle personen