From e67f77ddd6315c884df1b508ff6eb081ce1be3d4 Mon Sep 17 00:00:00 2001 From: Felix Wolfsteller Date: Sat, 10 Oct 2020 14:22:28 +0200 Subject: [PATCH] more translations and ingore day_names i18n (#31) --- app/controllers/application_controller.rb | 4 ++-- app/views/admin/users/show.html.haml | 15 ++++++++++----- app/views/styles/show.html.haml | 17 ++++++++++------- app/views/terms_acceptances/show.html.haml | 4 ++-- config/i18n-tasks.yml | 7 ++++--- config/locales/actions.de.yml | 3 +++ config/locales/admin.de.yml | 7 +++++++ config/locales/de.yml | 11 ++++++++++- 8 files changed, 48 insertions(+), 20 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ff37c6c..a09dcca 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 3331e16..b5f36bb 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -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' @@ -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') @@ -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 @@ -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 diff --git a/app/views/styles/show.html.haml b/app/views/styles/show.html.haml index 898d57d..3b8f757 100644 --- a/app/views/styles/show.html.haml +++ b/app/views/styles/show.html.haml @@ -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/ @@ -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 @@ -191,4 +194,4 @@ %hr -= link_to t('Back'), :back, class: 'button is-link' += link_to t('actions.Back'), :back, class: 'button is-primary' diff --git a/app/views/terms_acceptances/show.html.haml b/app/views/terms_acceptances/show.html.haml index 2803405..b76b68b 100644 --- a/app/views/terms_acceptances/show.html.haml +++ b/app/views/terms_acceptances/show.html.haml @@ -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'] @@ -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') diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index a432c0b..137cfdc 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -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: diff --git a/config/locales/actions.de.yml b/config/locales/actions.de.yml index 55eb258..71a55ed 100644 --- a/config/locales/actions.de.yml +++ b/config/locales/actions.de.yml @@ -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. diff --git a/config/locales/admin.de.yml b/config/locales/admin.de.yml index adbb3f8..e7288f8 100644 --- a/config/locales/admin.de.yml +++ b/config/locales/admin.de.yml @@ -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 diff --git a/config/locales/de.yml b/config/locales/de.yml index 3e1bb75..c958c91 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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: @@ -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