Skip to content

Commit

Permalink
more translations and ingore day_names i18n (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwolfst committed Oct 10, 2020
1 parent 0f6ad71 commit e67f77d
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def authorize_admin!
if true_user&.admin?
# happy face
else
flash[:error] = t('not authorized')
flash[:error] = t('problems.not_authorized')
redirect_to root_path
end
end

def authorize_user!
if !user_signed_in?
flash[:error] = t('you need to log in')
flash[:error] = t('problems.you_need_to_log_in')
redirect_to root_path
end
end
Expand Down
15 changes: 10 additions & 5 deletions app/views/admin/users/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.level
.level-left
%h1.title
= t('user.user-heading')
= t('admin.user.user-heading')
.level-right
.level-item
= link_to t('admin.user.impersonate'), impersonate_user_path(@user), method: :post, class: 'button'
Expand All @@ -24,7 +24,7 @@
= @user.confirmed_at
- if @user.confirmed_at.nil?
%span.tag
= t('user.unconfirmed')
= t('admin.user.unconfirmed')

%p
%b= t('admin.user.sign_in_count')
Expand All @@ -35,7 +35,7 @@
= @user.last_sign_in_at
- if @user.last_sign_in_at.nil?
%span.tag
= t('user.never-signed-in')
= t('admin.user.never-signed-in')

%br
%br
Expand Down Expand Up @@ -73,8 +73,13 @@
%td
= subscription.notes
%td
= link_to t('edit'), edit_admin_user_subscription_path(subscription.user, subscription), class: 'button'
= link_to t('delete'), [:admin, subscription.user, subscription], method: :delete, date: { confirm: t('are_you_sure?') }, class: 'button'
= link_to t('edit'),
edit_admin_user_subscription_path(subscription.user, subscription),
class: 'button'
= link_to t('delete'), [:admin, subscription.user, subscription],
method: :delete,
data: { confirm: t('actions.are_you_sure?') },
class: 'button'
%tr
%td(colspan=2)
= link_to new_admin_user_subscription_path(user_id: @user), class: 'button' do
Expand Down
17 changes: 10 additions & 7 deletions app/views/styles/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,15 @@
%span.icon.is-small
%i.fas.fa-user-shield
%span
= t('style.admin.edit-lesson')
= link_to [:admin, lesson.style, lesson], method: :delete, data: { confirm: t('actions.are_you_sure?') }, class: 'button is-link is-outlined is-small' do
= t('admin.styles.edit-lesson')
= link_to [:admin, lesson.style, lesson],
method: :delete,
data: { confirm: t('actions.are_you_sure?') },
class: 'button is-link is-outlined is-small' do
%span.icon.is-small
%i.fas.fa-user-shield
%span
= t('style.admin.destroy-lesson')
= t('admin.styles.destroy-lesson')
= l lesson.created_at, format: '%A, %d. %B %Y'
- if lesson.video.attached? && lesson.video.metadata[:duration]
%br/
Expand Down Expand Up @@ -168,13 +171,13 @@
%span.icon.is-small
%i.fas.fa-user-shield
%span
= t('style.admin.edit-lesson')
= t('admin.styles.edit-lesson')

= link_to [:admin, lesson.style, lesson], method: :delete, data: { confirm: 'Are you sure?' }, class: 'button is-link is-outlined' do
= link_to [:admin, lesson.style, lesson], method: :delete, data: { confirm: t('actions.are_you_sure?') }, class: 'button is-link is-outlined' do
%span.icon.is-small
%i.fas.fa-user-shield
%span
= t('style.admin.destroy-lesson')
= t('admin.styles.destroy-lesson')

.buttons
= link_to new_admin_style_lesson_path(@style), class: 'button' do
Expand All @@ -191,4 +194,4 @@

%hr

= link_to t('Back'), :back, class: 'button is-link'
= link_to t('actions.Back'), :back, class: 'button is-primary'
4 changes: 2 additions & 2 deletions app/views/terms_acceptances/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
!= SiteSetting['privacy_statement']

%h1.title
= t('terms')
= t('pages.terms.title')
.container.mb-5
.content.is-medium.has-text-justified
!= SiteSetting['terms']
Expand All @@ -26,7 +26,7 @@
= f.check_box :read_privacy_terms
= label_tag :read_privacy_terms, t('activerecord.attributes.user.read_privacy_terms')
.actions
= f.submit t('Save'), class: 'button is-primary'
= f.submit t('actions.Save'), class: 'button is-primary'
.column.is-half
%h2.title
= t('.actions')
Expand Down
7 changes: 4 additions & 3 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ search:
# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"

## Do not consider these keys missing:
# ignore_missing:
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
# - '{devise,simple_form}.*'
ignore_missing:
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
# - '{devise,simple_form}.*'
- date.day_names

## Consider these keys used:
ignore_unused:
Expand Down
3 changes: 3 additions & 0 deletions config/locales/actions.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ de:
edit: bearbeiten
save: speichern
show: anzeigen
problems:
not_authorized: Du bist dazu nicht autorisiert.
you_need_to_log_in: Du musst dich einloggen um diese Seite zu sehen.
7 changes: 7 additions & 0 deletions config/locales/admin.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@ de:
cannot-delete-with-videos: Kann Style nicht löschen wenn noch Videos zugeordnet sind.
creation-success: Style erstellt
deletion-success: Style gelöscht
destroy-lesson: Video löschen
edit: Style bearbeiten
edit-lesson: Video bearbeiten
index:
listing: Alle Styles
new: Neuer Style
new-video: Neues Video
update-success: Style aktualisiert
admin:
user:
never-signed-in: Noch nie eingeloggt
unconfirmed: unbestätigt
user-heading: User
11 changes: 10 additions & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,20 @@ de:
impressum: Impressum
privacy_statement: Datenschutzhinweise
terms: AGB
places: Orte
programs: Programme
seminars: Seminare
site_settings: Seiten-Einstellungen
styles: Styles
user:
account: Mein Konto
users: User
videos: Videos
no-video-support: Dein Browser unterstützt keine Videos!
not authorized: Nicht authorisiert
pages:
courses_general: Allgemeines zu den Kursen
terms:
title: AGB
pagy:
showing_from_to_total: Zeige %{item_name} %{from}-%{to} von %{total} gesamt.
register:
Expand Down Expand Up @@ -336,10 +339,16 @@ de:
your-subscription-ended: Dein Abonnement ist abgelaufen
your-trial-ended: Deine Schnupperwoche ist abgelaufen
terms_acceptances:
actions: Aktionen
create:
welcome: Super! Willkommen und viel Spaß!
privacy_statement: Datenschutzerklärung
show:
acceptance: Zustimmung
anonymize: Mein Konto zerstören
get_my_data: Zeig mir meine Daten!
have_to_agree: Du musst den AGB zustimmen und die Datenschutzerklärung als gelesen markieren.
not-happy?: Wenn Du den AGBs nicht zustimmen möchtest oder die Angabe Deiner Daten zu heikel ist, musst Du Dein Konto bei uns leider aufgeben.
user:
confirmed_at: Bestätigt am
created_at: Erstellt am
Expand Down

0 comments on commit e67f77d

Please sign in to comment.