Browse Source

i18n l10n authentication

Maarten van den Berg 7 years ago
parent
commit
0c505b9eea

+ 2 - 2
app/views/activities/_wide_presence_buttons.haml

5
         %i.fa.fa-check
5
         %i.fa.fa-check
6
       - else
6
       - else
7
         %i.fa.fa-check-circle
7
         %i.fa.fa-check-circle
8
-      Present
8
+      = t 'activitites.state.present'
9
 
9
 
10
   .btn-group
10
   .btn-group
11
     %button.btn.btn-danger.btn-absent.btn-presence{data: {wide: 1, person_id: person.id, activity_id: activity.id, group_id: activity.group.id, new_state: "absent"}}
11
     %button.btn.btn-danger.btn-absent.btn-presence{data: {wide: 1, person_id: person.id, activity_id: activity.id, group_id: activity.group.id, new_state: "absent"}}
13
         %i.fa.fa-times-circle
13
         %i.fa.fa-times-circle
14
       - else
14
       - else
15
         %i.fa.fa-times
15
         %i.fa.fa-times
16
-      Absent
16
+      = t 'activitites.state.absent'

+ 7 - 7
app/views/authentication/confirm_account_form.html.haml

1
 - content_for :title do
1
 - content_for :title do
2
-  Confirm account
2
+  = t 'authentication.confirm_account'
3
 .container
3
 .container
4
   = render 'shared/alerts'
4
   = render 'shared/alerts'
5
   = form_for :account_confirmation, url: {action: 'confirm_account', token: params[:token]}, html: { class: 'central-form'} do |f|
5
   = form_for :account_confirmation, url: {action: 'confirm_account', token: params[:token]}, html: { class: 'central-form'} do |f|
6
     %h2.central-form-header.text-center
6
     %h2.central-form-header.text-center
7
-      Confirm account
7
+      = t 'authentication.confirm_account'
8
 
8
 
9
-    = f.password_field :password, placeholder: "New password", class: 'form-control input-top'
10
-    = f.password_field :password_confirmation, placeholder: "Confirm new password", class: 'form-control input-bottom'
11
-    = f.submit "Confirm account", class: 'btn btn-primary btn-lg btn-block'
9
+    = f.password_field :password, placeholder: t('authentication.new_password'), class: 'form-control input-top'
10
+    = f.password_field :password_confirmation, placeholder: t('authentication.new_password_confirm'), class: 'form-control input-bottom'
11
+    = f.submit t('authentication.confirm_account'), class: 'btn btn-primary btn-lg btn-block'
12
 
12
 
13
   .central-form
13
   .central-form
14
     %ul.hdis
14
     %ul.hdis
15
       %li
15
       %li
16
-        = link_to "Login",          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
16
+        = link_to t(:log_in),          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
17
       %li
17
       %li
18
-        = link_to "Create account", {action: 'create_password', controller: 'authentication'}, {class: 'btn btn-secondary'}
18
+        = link_to t('authentication.create_account'), {action: 'create_password', controller: 'authentication'}, {class: 'btn btn-secondary'}

+ 7 - 7
app/views/authentication/create_password_form.html.haml

1
 - content_for :title do
1
 - content_for :title do
2
-  Create password
2
+  = t 'authentication.create_account'
3
 
3
 
4
 .container
4
 .container
5
   = render 'shared/alerts'
5
   = render 'shared/alerts'
6
   = form_for :user, url: '/register', html: {class: 'central-form'} do |f|
6
   = form_for :user, url: '/register', html: {class: 'central-form'} do |f|
7
     %h2.central-form-header.text-center
7
     %h2.central-form-header.text-center
8
-      Create password
8
+      = t 'authentication.create_account'
9
     %p
9
     %p
10
-      Creating an account requires that you have been registered beforehand by an administrator. Contact someone if your email address is not recognized.
10
+      = t 'authentication.need_introducer'
11
 
11
 
12
-    = f.email_field :email, placeholder: 'Email address', class: 'form-control input-only'
13
-    = f.submit "Send email", class: 'btn btn-primary btn-lg btn-block'
12
+    = f.email_field :email, placeholder: t('person.attrs.email'), class: 'form-control input-only'
13
+    = f.submit t(:send_email), class: 'btn btn-primary btn-lg btn-block'
14
 
14
 
15
   .central-form
15
   .central-form
16
     %ul.hdis
16
     %ul.hdis
17
       %li
17
       %li
18
-        = link_to "Login",          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
18
+        = link_to t(:log_in),          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
19
       %li
19
       %li
20
-        = link_to "Forgot password", {action: 'forgotten_password', controller: 'authentication'}, {class: 'btn btn-secondary'}
20
+        = link_to t('authentication.forgot_password'), {action: 'forgotten_password', controller: 'authentication'}, {class: 'btn btn-secondary'}

+ 6 - 6
app/views/authentication/forgotten_password_form.html.haml

1
 - content_for :title do
1
 - content_for :title do
2
-  Forgot password
2
+  = t 'authentication.forgot_password'
3
 .container
3
 .container
4
   = render 'shared/alerts'
4
   = render 'shared/alerts'
5
   = form_for :password_reset, url: '/forgot', html: {class:'central-form'} do |f|
5
   = form_for :password_reset, url: '/forgot', html: {class:'central-form'} do |f|
6
     %h2.central-form-header.text-center
6
     %h2.central-form-header.text-center
7
-      Forgot password
7
+      = t 'authentication.forgot_password'
8
 
8
 
9
-    = f.email_field :email, placeholder: "Email address", class: 'form-control input-only'
10
-    = f.submit "Send email", class: 'btn btn-primary btn-lg btn-block'
9
+    = f.email_field :email, placeholder: t('person.attrs.email'), class: 'form-control input-only'
10
+    = f.submit t(:send_email), class: 'btn btn-primary btn-lg btn-block'
11
 
11
 
12
   .central-form
12
   .central-form
13
     %ul.hdis
13
     %ul.hdis
14
       %li
14
       %li
15
-        = link_to "Login",          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
15
+        = link_to t(:log_in),          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
16
       %li
16
       %li
17
-        = link_to "Create account", {action: 'create_password', controller: 'authentication'}, {class: 'btn btn-secondary'}
17
+        = link_to t('authentication.create_account'), {action: 'create_password', controller: 'authentication'}, {class: 'btn btn-secondary'}

+ 8 - 8
app/views/authentication/login_form.html.haml

1
 - content_for :title do
1
 - content_for :title do
2
-  Login
2
+  = t :log_in
3
 
3
 
4
 .container
4
 .container
5
   = render 'shared/alerts'
5
   = render 'shared/alerts'
6
   = form_for :session, url: "/login", html: { class: "central-form"} do |f|
6
   = form_for :session, url: "/login", html: { class: "central-form"} do |f|
7
     %h2.central-form-header.text-center
7
     %h2.central-form-header.text-center
8
-      Please sign in
8
+      = t 'authentication.please_sign_in'
9
 
9
 
10
-    = f.email_field(:email, placeholder: 'Email address', class: 'form-control input-top')
11
-    = f.password_field(:password, placeholder: 'Password', class: 'form-control input-bottom')
10
+    = f.email_field(:email, placeholder: t('person.attrs.email'), class: 'form-control input-top')
11
+    = f.password_field(:password, placeholder: t('person.attrs.password'), class: 'form-control input-bottom')
12
 
12
 
13
     .checkbox
13
     .checkbox
14
       %label
14
       %label
15
         = f.check_box(:remember_me)
15
         = f.check_box(:remember_me)
16
-        Remember me
16
+        = t 'authentication.remember_me'
17
 
17
 
18
-    = f.submit("Sign in", class: "btn btn-primary btn-lg btn-block")
18
+    = f.submit(t(:log_in), class: "btn btn-primary btn-lg btn-block")
19
 
19
 
20
   .central-form
20
   .central-form
21
     %ul.hdis
21
     %ul.hdis
22
       %li
22
       %li
23
-        = link_to 'Forgot password', {action: 'forgotten_password', controller: 'authentication'}, {class: 'btn btn-secondary'}
23
+        = link_to t('authentication.forgot_password'), {action: 'forgotten_password', controller: 'authentication'}, {class: 'btn btn-secondary'}
24
       %li
24
       %li
25
-        = link_to 'Create account', {controller: 'authentication', action: 'create_password'}, {class: 'btn btn-secondary'}
25
+        = link_to t('authentication.create_account'), {controller: 'authentication', action: 'create_password'}, {class: 'btn btn-secondary'}

+ 3 - 3
app/views/authentication/logout_confirm.html.haml

1
 .container
1
 .container
2
   .panel.panel-default
2
   .panel.panel-default
3
     .panel-heading
3
     .panel-heading
4
-      Are you sure?
4
+      = t :areyousure
5
     .panel-body
5
     .panel-body
6
       = link_to logout_path, method: :delete, class: 'btn btn-danger' do
6
       = link_to logout_path, method: :delete, class: 'btn btn-danger' do
7
         %i.fa.fa-sign-out{'aria-hidden': true}
7
         %i.fa.fa-sign-out{'aria-hidden': true}
8
-        Log out
8
+        = t :log_out
9
       = link_to root_path, class: 'btn btn-default' do
9
       = link_to root_path, class: 'btn btn-default' do
10
-        Cancel
10
+        = t :cancel

+ 7 - 7
app/views/authentication/reset_password_form.html.haml

1
 - content_for :title do
1
 - content_for :title do
2
-  Reset password
2
+  = t 'authentication.reset_password'
3
 .container
3
 .container
4
   = render 'shared/alerts'
4
   = render 'shared/alerts'
5
   = form_for :password_reset, url: {action: 'reset_password', token: params[:token]}, html: { class: 'central-form'} do |f|
5
   = form_for :password_reset, url: {action: 'reset_password', token: params[:token]}, html: { class: 'central-form'} do |f|
6
     %h2.central-form-header.text-center
6
     %h2.central-form-header.text-center
7
-      Reset password
7
+      = t 'authentication.reset_password'
8
 
8
 
9
-    = f.password_field :password, placeholder: "New password", class: 'form-control input-top'
10
-    = f.password_field :password_confirmation, placeholder: "Confirm new password", class: 'form-control input-bottom'
11
-    = f.submit "Reset password", class: 'btn btn-primary btn-lg btn-block'
9
+    = f.password_field :password, placeholder: t('authentication.new_password'), class: 'form-control input-top'
10
+    = f.password_field :password_confirmation, placeholder: t('authentication.new_password_confirm'), class: 'form-control input-bottom'
11
+    = f.submit t('authentication.reset_password'), class: 'btn btn-primary btn-lg btn-block'
12
 
12
 
13
   .central-form
13
   .central-form
14
     %ul.hdis
14
     %ul.hdis
15
       %li
15
       %li
16
-        = link_to "Login",          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
16
+        = link_to t(:log_in),          {action: 'login',           controller: 'authentication'}, {class: 'btn btn-secondary'}
17
       %li
17
       %li
18
-        = link_to "Create account", {action: 'create_password', controller: 'authentication'}, {class: 'btn btn-secondary'}
18
+        = link_to t('authentication.create_account'), {action: 'create_password', controller: 'authentication'}, {class: 'btn btn-secondary'}

+ 14 - 0
config/locales/authentication/en.yml

1
+en:
2
+  authentication:
3
+    confirm_account: Create password
4
+    forgot_password: Forgot password
5
+    reset_password: Reset password
6
+    create_account: Create account
7
+
8
+    please_sign_in: Please sign in
9
+    remember_me: Remember me
10
+
11
+    new_password: New password
12
+    new_password_confirm: Confirm new password
13
+
14
+    need_introducer: Creating an account requires that you have been added to a group beforehand by an administrator. Contact someone if your email address is not recognized.

+ 14 - 0
config/locales/authentication/nl.yml

1
+nl:
2
+  authentication:
3
+    confirm_account: Wachtwoord aanmaken
4
+    forgot_password: Wachtwoord vergeten
5
+    reset_password: Wachtwoord veranderen
6
+    create_account: Account aanmaken
7
+
8
+    please_sign_in: Log eerst in
9
+    remember_me: Onthouden
10
+
11
+    new_password: Nieuw wachtwoord
12
+    new_password_confirm: Herhaal nieuw wachtwoord
13
+
14
+    need_introducer: Je kan alleen een account aanmaken wanneer je door een beheerder aan een groep bent toegevoegd. Neem contact op met iemand wanneer je emailadres niet wordt herkend.

+ 1 - 0
config/locales/en.yml

32
   show: Show
32
   show: Show
33
   edit: Edit
33
   edit: Edit
34
   destroy: Delete
34
   destroy: Delete
35
+  send_email: Send email
35
 
36
 
36
   areyousure: Are you sure?
37
   areyousure: Are you sure?

+ 1 - 0
config/locales/nl.yml

11
   show: Weergeven
11
   show: Weergeven
12
   edit: Bewerken
12
   edit: Bewerken
13
   destroy: Verwijderen
13
   destroy: Verwijderen
14
+  send_email: Email versturen
14
 
15
 
15
   areyousure: Weet je het zeker?
16
   areyousure: Weet je het zeker?

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

3
     singular: Person
3
     singular: Person
4
     plural: People
4
     plural: People
5
     all: All persons
5
     all: All persons
6
+
7
+    attrs:
8
+      email: Email address
9
+      password: Password

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

3
     singular: Persoon
3
     singular: Persoon
4
     plural: Personen
4
     plural: Personen
5
     all: Alle personen
5
     all: Alle personen
6
+
7
+    attrs:
8
+      email: Emailadres
9
+      password: Wachtwoord