From 47ad0a6133d6578a6a1c010bb07d94763e6e99c1 Mon Sep 17 00:00:00 2001 From: Xu Date: Thu, 23 Nov 2023 17:37:06 +0100 Subject: [PATCH] fix translation keys in twig templates --- includes/pages/admin_arrive.php | 6 +- includes/pages/admin_free.php | 2 +- includes/pages/admin_user.php | 2 +- resources/lang/de_DE/default.po | 82 ++++++------- resources/lang/en_US/default.po | 115 +++++++++++++++++- resources/views/emails/mail.twig | 6 +- resources/views/emails/password-reset.twig | 2 +- resources/views/layouts/parts/footer.twig | 12 +- resources/views/layouts/parts/navbar.twig | 6 +- resources/views/pages/credits.twig | 8 +- resources/views/pages/design.twig | 2 +- resources/views/pages/login.twig | 26 ++-- resources/views/pages/messages/overview.twig | 4 +- .../views/pages/password/reset-form.twig | 2 +- .../views/pages/password/reset-success.twig | 4 +- resources/views/pages/password/reset.twig | 8 +- 16 files changed, 198 insertions(+), 89 deletions(-) diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php index 891822f6..b56726a6 100644 --- a/includes/pages/admin_arrive.php +++ b/includes/pages/admin_arrive.php @@ -218,7 +218,7 @@ function admin_arrive() 'sum' => '#888', ], $planned_arrival_at_day), table([ - 'day' => __('Date'), + 'day' => __('title.date'), 'count' => __('general.count'), 'sum' => __('Sum'), ], $planned_arrival_at_day), @@ -233,7 +233,7 @@ function admin_arrive() 'sum' => '#888', ], $arrival_at_day), table([ - 'day' => __('Date'), + 'day' => __('title.date'), 'count' => __('general.count'), 'sum' => __('Sum'), ], $arrival_at_day), @@ -248,7 +248,7 @@ function admin_arrive() 'sum' => '#888', ], $planned_departure_at_day), table([ - 'day' => __('Date'), + 'day' => __('title.date'), 'count' => __('general.count'), 'sum' => __('Sum'), ], $planned_departure_at_day), diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php index 6109df5f..43d604e2 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -124,7 +124,7 @@ function admin_free() ]), table([ 'name' => __('general.name'), - 'shift_state' => __('Next shift'), + 'shift_state' => __('shift.next'), 'last_shift' => __('Last shift'), 'dect' => __('general.dect'), 'email' => __('general.email'), diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 1bd96ac1..26e07f89 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -149,7 +149,7 @@ function admin_user() $html .= form_csrf(); $html .= '' . "\n"; $html .= ' ' . "\n"; - $html .= ' ' . "\n"; + $html .= ' ' . "\n"; $html .= '
' . __('settings.password') . '' . '
' . __('Confirm password') . '' . '
' . __('password.reset.confirm') . '' . '
' . "\n" . '
' . "\n"; $html .= '' . "\n"; diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 0ac700e4..76228453 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -18,21 +18,19 @@ msgstr "" "X-Poedit-SearchPath-1: src\n" "X-Poedit-SearchPath-2: includes\n" -msgid "Hi %s," +msgid "email.greeting" msgstr "Hallo %s," -msgid "here is a message for you from the %s:" +msgid "email.introduction" msgstr "hier ist eine Nachricht aus dem %s für Dich:" -msgid "" -"This e-mail is autogenerated and has not been signed. You got this e-mail " -"because you are registered in the %s." +msgid "email.footer" msgstr "" "Diese E-Mail wurde automatisch generiert und muss daher nicht unterschrieben " "werden. Du hast diese E-Mail bekommen, weil Du im %s registriert bist." -msgid "Please visit %s to recover your password." -msgstr "Bitte besuche %s, um Dein Passwort zurückzusetzen" +msgid "password.email.message" +msgstr "Bitte besuche %s, um Dein Passwort zurückzusetzen." msgid "Forbidden" msgstr "Nicht erlaubt" @@ -58,25 +56,25 @@ msgstr "Das angegebene CSRF Token ist ungültig oder abgelaufen" msgid "general.date" msgstr "d.m.Y" -msgid "%1$s, from %2$s to %3$s" +msgid "footer.eventinfo.name_start_end" msgstr "%1$s, vom %2$s bis %3$s" -msgid "%1$s, starting %2$s" +msgid "footer.eventinfo.name_start" msgstr "%1$s, ab dem %2$s" -msgid "Event from %1$s to %2$s" +msgid "footer.eventinfo.start_end" msgstr "Event von %1$s bis %2$s" -msgid "Bugs / Features" +msgid "footer.issues" msgstr "Bugs / Features" -msgid "Development Platform" +msgid "footer.github" msgstr "Entwicklerplattform" -msgid "Credits" +msgid "credits.title" msgstr "Credits" -msgid "Register" +msgid "general.register" msgstr "Registrieren" msgid "general.login" @@ -88,11 +86,11 @@ msgstr "Bitte melde dich an." msgid "form.submit" msgstr "Absenden" -msgid "Source code" +msgid "credits.source" msgstr "Quellcode" -msgid "Version: _%s_" -msgstr "" +msgid "credits.version" +msgstr "Version: _%s_" msgid "credits.credit" msgstr "" @@ -106,65 +104,60 @@ msgstr "" "Eine vollständige Liste der Mitwirkenden findest Du [auf GitHub](https://" "github.com/engelsystem/engelsystem/graphs/contributors)." -msgid "Welcome to the %s!" +msgid "login.welcome" msgstr "Willkommen beim %s!" -msgid "Buildup starts" +msgid "event.buildup.start" msgstr "Aufbau startet" -msgid "Event starts" +msgid "event.starts" msgstr "Event startet" -msgid "Event ends" +msgid "event.ends" msgstr "Event endet" -msgid "Teardown ends" +msgid "event.teardown.ends" msgstr "Abbau endet" -msgid "I forgot my password" +msgid "login.password.reset" msgstr "Passwort vergessen" -msgid "Please sign up, if you want to help us!" +msgid "login.registration" msgstr "Bitte registriere Dich, wenn Du helfen möchtest!" -msgid "Registration is only available via external login." +msgid "login.registration.external" msgstr "Die Registrierung ist nur über einen externen Login möglich." -msgid "Registration is disabled." +msgid "login.registration.disabled" msgstr "Registrierung ist abgeschaltet." -msgid "What can I do?" +msgid "login.do" msgstr "Was kann ich machen?" -msgid "Please read about the jobs you can do to help us." +msgid "login.jobs" msgstr "" "Bitte informiere Dich über die Tätigkeiten bei denen Du uns helfen kannst." -msgid "Please note: You have to activate cookies!" +msgid "login.cookies" msgstr "Hinweis: Cookies müssen aktiviert sein!" -msgid "Confirm password" +msgid "password.reset.confirm" msgstr "Passwort wiederholen" -msgid "We sent you an e-mail containing your password recovery link." +msgid "password.recovery.success" msgstr "" "Wir haben dir eine E-Mail mit einem Link zum Passwort-zurücksetzen geschickt." -msgid "Password saved." -msgstr "Passwort gespeichert." - -msgid "Password recovery" +msgid "password.reset.title" msgstr "Passwort wiederherstellen" -msgid "" -"We will send you an e-mail with a password recovery link. Please use the " -"e-mail address you used for registration." +msgid "password.recovery.text" msgstr "" "Wir werden eine E-Mail mit einem Link schicken, mit dem du das Passwort " "zurücksetzen kannst. Bitte benutze die E-Mail-Adresse, die du bei der Anmeldung " "verwendet hast." -msgid "Recover" +msgid "form.recover" msgstr "Wiederherstellen" msgid "Angeltype %s deleted." @@ -604,7 +597,7 @@ msgstr "Geplante Ankunfts-Statistik" msgid "arrived sum" msgstr "Summe angekommen" -msgid "Date" +msgid "title.date" msgstr "Datum" msgid "Arrival statistics" @@ -619,7 +612,7 @@ msgstr "Freie Engel" msgid "Angeltype" msgstr "Engeltyp" -msgid "Next shift" +msgid "shift.next" msgstr "Nächste Schicht" msgid "Last shift" @@ -862,7 +855,7 @@ msgstr "Alle" msgid "None" msgstr "Keine" -msgid "Logout" +msgid "general.logout" msgstr "Abmelden" msgid "Admin" @@ -1859,7 +1852,7 @@ msgstr "Zur Konversation" msgid "message.message" msgstr "Nachricht" -msgid "angel" +msgid "general.angel" msgstr "Engel" msgid "worklog.add" @@ -2001,3 +1994,6 @@ msgstr "Benutzer Info" msgid "user.info.hint" msgstr "Wird auf der Benutzer Seite für Schichtkoordinatoren und Admins angezeigt." + +msgid "design.title" +msgstr "Design" diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index 940ecf12..6baa78d7 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -312,7 +312,7 @@ msgid "settings.password.password" msgstr "Old password" msgid "settings.password.new_password" -msgstr "New passwort" +msgstr "New password" msgid "settings.password.new_password2" msgstr "Password confirmation" @@ -710,3 +710,116 @@ msgstr "User info" msgid "user.info.hint" msgstr "Is displayed for shift coordinators and admins in the user view." + +msgid "email.greeting" +msgstr "Hi %s," + +msgid "email.introduction" +msgstr "here is a message for you from the %s:" + +msgid "email.footer" +msgstr "" +"This e-mail is autogenerated and has not been signed. " +"You got this e-mail because you are registered in the %s." + +msgid "password.email.message" +msgstr "Please visit %s to recover your password." + +msgid "footer.eventinfo.start_end" +msgstr "%1$s, from %2$s to %3$s" + +msgid "footer.eventinfo.name_start" +msgstr "%1$s, ab dem %2$s" + +msgid "footer.eventinfo.name_start" +msgstr "%1$s, starting %2$s" + +msgid "footer.eventinfo.start_end" +msgstr "Event from %1$s to %2$s" + +msgid "footer.issues" +msgstr "Bugs / Features" + +msgid "footer.github" +msgstr "Development Platform" + +msgid "credits.title" +msgstr "Credits" + +msgid "general.register" +msgstr "Register" + +msgid "shift.next" +msgstr "Next shift" + +msgid "general.logout" +msgstr "Logout" + +msgid "credits.source" +msgstr "Source code" + +msgid "credits.version" +msgstr "Version: _%s_" + +msgid "design.title" +msgstr "Design" + +msgid "login.welcome" +msgstr "Welcome to the %s!" + +msgid "event.buildup.start" +msgstr "Buildup starts" + +msgid "event.starts" +msgstr "Event starts" + +msgid "event.ends" +msgstr "Event ends" + +msgid "event.teardown.ends" +msgstr "Teardown ends" + +msgid "login.password.reset" +msgstr "I forgot my password" + +msgid "login.registration" +msgstr "Please sign up, if you want to help us!" + +msgid "login.registration.external" +msgstr "Registration is only available via external login." + +msgid "login.registration.disabled" +msgstr "Registration is disabled." + +msgid "login.do" +msgstr "What can I do?" + +msgid "login.jobs" +msgstr "" +"Please read about the jobs you can do to help us." + +msgid "login.cookies" +msgstr "Please note: You have to activate cookies!" + +msgid "general.angel" +msgstr "Angel" + +msgid "title.date" +msgstr "Date" + +msgid "password.reset.confirm" +msgstr "Confirm password" + +msgid "password.recovery.success" +msgstr "We sent you an e-mail containing your password recovery link." + +msgid "password.reset.title" +msgstr "Password recovery" + +msgid "password.recovery.text" +msgstr "" +"We will send you an e-mail with a password recovery link. " +"Please use the e-mail address you used for registration." + +msgid "form.recover" +msgstr "Recover" diff --git a/resources/views/emails/mail.twig b/resources/views/emails/mail.twig index dd9e6bd9..e008620c 100644 --- a/resources/views/emails/mail.twig +++ b/resources/views/emails/mail.twig @@ -1,6 +1,6 @@ -{% block title %}{{ __('Hi %s,', [username]) }}{% endblock %} +{% block title %}{{ __('email.greeting', [username]) }}{% endblock %} -{% block introduction %}{{ __('here is a message for you from the %s:', [config('app_name')]) }}{% endblock %} +{% block introduction %}{{ __('email.introduction', [config('app_name')]) }}{% endblock %} {% block message %}{{ message|raw }}{% endblock %} @@ -10,5 +10,5 @@ {%- if config('enable_show_day_of_event') and day_of_event is defined %} , {{ __('event.day', [day_of_event]) }} {% endif %} -{{ __('This e-mail is autogenerated and has not been signed. You got this e-mail because you are registered in the %s.', [config('app_name')]) }} +{{ __('email.footer', [config('app_name')]) }} {% endblock %} diff --git a/resources/views/emails/password-reset.twig b/resources/views/emails/password-reset.twig index 30b613b4..f9729934 100644 --- a/resources/views/emails/password-reset.twig +++ b/resources/views/emails/password-reset.twig @@ -1,3 +1,3 @@ {% extends "emails/mail.twig" %} -{% block message %}{{ __('Please visit %s to recover your password.', [url('/password/reset/') ~ reset.token]) }}{% endblock %} +{% block message %}{{ __('password.email.message', [url('/password/reset/') ~ reset.token]) }}{% endblock %} diff --git a/resources/views/layouts/parts/footer.twig b/resources/views/layouts/parts/footer.twig index 3549fa81..72d9ff61 100644 --- a/resources/views/layouts/parts/footer.twig +++ b/resources/views/layouts/parts/footer.twig @@ -6,7 +6,7 @@ {% block eventinfo %} {% if config('name') %} {% if config('event_start') and config('event_end') %} - {{ __('%1$s, from %2$s to %3$s', [ + {{ __('footer.eventinfo.name_start_end', [ config('name'), config('event_start').format(__('general.date')), config('event_end').format(__('general.date')) @@ -15,7 +15,7 @@ , {{ __('event.day', [day_of_event]) }} {% endif %} {% elseif config('event_start') %} - {{ __('%1$s, starting %2$s', [ + {{ __('footer.eventinfo.name_start', [ config('name'), config('event_start').format(__('general.date')) ]) }} @@ -26,7 +26,7 @@ {{ config('name') }} {% endif %}
{% elseif config('event_start') and config('event_end') %} - {{ __('Event from %1$s to %2$s', [ + {{ __('footer.eventinfo.start_end', [ config('event_start').format(__('general.date')), config('event_end').format(__('general.date')) ]) }} @@ -42,8 +42,8 @@ {{ __(name) }} · {% endfor %} - {{ __('Bugs / Features') }} - · {{ __('Development Platform') }} - · {{ __('Credits') }} + {{ __('footer.issues') }} + · {{ __('footer.github') }} + · {{ __('credits.title') }} diff --git a/resources/views/layouts/parts/navbar.twig b/resources/views/layouts/parts/navbar.twig index 55ab2325..e9eb07b2 100644 --- a/resources/views/layouts/parts/navbar.twig +++ b/resources/views/layouts/parts/navbar.twig @@ -59,7 +59,7 @@ {% include "layouts/parts/language_dropdown.twig" %} {% if has_permission_to('register') and config('registration_enabled') %} - {{ _self.toolbar_item(__('Register'), url('/register'), 'register', 'plus') }} + {{ _self.toolbar_item(__('general.register'), url('/register'), 'register', 'plus') }} {% endif %} {% if has_permission_to('login') %} @@ -68,7 +68,7 @@ {% endif %} {% if is_user() %} - {{ _self.toolbar_item(menuUserShiftState(user), url('/shifts', {'action': 'next'}), '', 'clock', __('Next shift')) }} + {{ _self.toolbar_item(menuUserShiftState(user), url('/shifts', {'action': 'next'}), '', 'clock', __('shift.next')) }} {% if has_permission_to('user_messages') %} {{ _self.toolbar_item( @@ -96,7 +96,7 @@ {% endif %} {% if has_permission_to('logout') %} - {{ _self.dropdown_item(__('Logout'), url('/logout'), 'logout', m.icon('box-arrow-left')) }} + {{ _self.dropdown_item(__('general.logout'), url('/logout'), 'logout', m.icon('box-arrow-left')) }} {% endif %} diff --git a/resources/views/pages/credits.twig b/resources/views/pages/credits.twig index 7e0d3890..c5a1ca06 100644 --- a/resources/views/pages/credits.twig +++ b/resources/views/pages/credits.twig @@ -1,10 +1,10 @@ {% extends "layouts/app.twig" %} -{% block title %}{{ __('Credits') }}{% endblock %} +{% block title %}{{ __('credits.title') }}{% endblock %} {% block content %}
-

{{ __('Credits') }}

+

{{ __('credits.title') }}

{% for title, credit in credits %}
@@ -14,8 +14,8 @@ {% endfor %}
-

{{ __('Source code') }}

-

{{ __('Version: _%s_', [version])|markdown }}

+

{{ __('credits.source') }}

+

{{ __('credits.version', [version])|markdown }}

{{ __('credits.credit')|markdown }}

diff --git a/resources/views/pages/design.twig b/resources/views/pages/design.twig index e8b8eb41..e6ee4034 100644 --- a/resources/views/pages/design.twig +++ b/resources/views/pages/design.twig @@ -2,7 +2,7 @@ {% import 'macros/base.twig' as m %} {% import 'macros/form.twig' as f %} -{% block title %}{{ __('Design') }}{% endblock %} +{% block title %}{{ __('design.title') }}{% endblock %} {% set colors=['success', 'info', 'warning', 'danger'] %} {% set types=[ diff --git a/resources/views/pages/login.twig b/resources/views/pages/login.twig index 4c8cc1bc..49129f5d 100644 --- a/resources/views/pages/login.twig +++ b/resources/views/pages/login.twig @@ -7,16 +7,16 @@
-

{{ __('Welcome to the %s!', [config('name') ~ m.angel() ~ (config('app_name')|upper) ])|raw }}

+

{{ __('login.welcome', [config('name') ~ m.angel() ~ (config('app_name')|upper) ])|raw }}

{% for name,date in { - (__('Buildup starts')): config('buildup_start'), - (__('Event starts')): config('event_start'), - (__('Event ends')): config('event_end'), - (__('Teardown ends')): config('teardown_end') + (__('event.buildup.start')): config('buildup_start'), + (__('event.starts')): config('event_start'), + (__('event.ends')): config('event_end'), + (__('event.teardown.ends')): config('teardown_end') } | filter(date => date) %} {% if date > date() %}
@@ -91,7 +91,7 @@ @@ -102,21 +102,21 @@
-

{{ __('Register') }}

+

{{ __('general.register') }}

{% if has_permission_to('register') and config('registration_enabled') %} {% if config('enable_password') %} -

{{ __('Please sign up, if you want to help us!') }}

- {{ __('Register') }} » +

{{ __('login.registration') }}

+ {{ __('general.register') }} » {% else %} -

{{ __('Registration is only available via external login.') }}

+

{{ __('login.registration.external') }}

{% endif %} {% else %} - {{ m.alert(__('Registration is disabled.'), 'danger') }} + {{ m.alert(__('login.registration.disabled'), 'danger') }} {% endif %}
-

{{ __('What can I do?') }}

+

{{ __('login.do') }}

{{ __('Please read about the jobs you can do to help us.') }}

{{ __('angeltypes.about') }} » @@ -124,7 +124,7 @@
- {{ m.icon('info-circle') }} {{ __('Please note: You have to activate cookies!') }} + {{ m.icon('info-circle') }} {{ __('login.cookies') }}
diff --git a/resources/views/pages/messages/overview.twig b/resources/views/pages/messages/overview.twig index c5f1f00e..9a1392a2 100644 --- a/resources/views/pages/messages/overview.twig +++ b/resources/views/pages/messages/overview.twig @@ -30,9 +30,9 @@ - + - + diff --git a/resources/views/pages/password/reset-form.twig b/resources/views/pages/password/reset-form.twig index 3f99c6aa..06b33a85 100644 --- a/resources/views/pages/password/reset-form.twig +++ b/resources/views/pages/password/reset-form.twig @@ -12,7 +12,7 @@ 'min_length': min_length, 'required': true, }) }} - {{ f.input('password_confirmation', __('Confirm password'), { + {{ f.input('password_confirmation', __('password.reset.confirm'), { 'type': 'password', 'min_length': min_length, 'required': true, diff --git a/resources/views/pages/password/reset-success.twig b/resources/views/pages/password/reset-success.twig index 436b928d..078f18a0 100644 --- a/resources/views/pages/password/reset-success.twig +++ b/resources/views/pages/password/reset-success.twig @@ -4,9 +4,9 @@ {% block row_content %}
{% if type == 'email' %} - {{ m.alert(__('We sent you an e-mail containing your password recovery link.'), 'info') }} + {{ m.alert(__('password.recovery.success'), 'info') }} {% elseif type == 'reset' %} - {{ m.alert(__('Password saved.'), 'success') }} + {{ m.alert(__('settings.password.success'), 'success') }} {% endif %}
{% endblock %} diff --git a/resources/views/pages/password/reset.twig b/resources/views/pages/password/reset.twig index a2886648..84613743 100644 --- a/resources/views/pages/password/reset.twig +++ b/resources/views/pages/password/reset.twig @@ -2,11 +2,11 @@ {% import 'macros/base.twig' as m %} {% import 'macros/form.twig' as f %} -{% block title %}{{ __('Password recovery') }}{% endblock %} +{% block title %}{{ __('password.reset.title') }}{% endblock %} {% block content %}
-

{{ __('Password recovery') }}

+

{{ __('password.reset.title') }}

{% include 'layouts/parts/messages.twig' %} @@ -16,13 +16,13 @@
{{ csrf() }} - {{ __('We will send you an e-mail with a password recovery link. Please use the e-mail address you used for registration.') }} + {{ __('password.recovery.text') }} {{ f.input('email', __('general.email'), { 'type': 'email', 'required': true, }) }} - {{ f.submit(__('Recover')) }} + {{ f.submit(__('form.recover')) }}
{% endblock %}
{{ __('angel') }}{{ __('general.angel') }} {{ __('message.message') }}{{ __('Date') }}{{ __('title.date') }}