From 6f8dad070cbbeab50658f56ecc5f4df07f271397 Mon Sep 17 00:00:00 2001 From: Xu Date: Thu, 9 May 2024 19:38:16 +0200 Subject: [PATCH] load day config from env, fixed multiple texts --- config/config.default.php | 4 ++-- includes/pages/admin_active.php | 4 ++-- includes/view/AngelTypes_view.php | 2 +- resources/lang/de_DE/default.po | 16 +++++----------- resources/lang/en_US/default.po | 4 ++-- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/config/config.default.php b/config/config.default.php index 14532336..4fc73725 100644 --- a/config/config.default.php +++ b/config/config.default.php @@ -409,9 +409,9 @@ return [ // Whether to show the current day of the event (-2, -1, 0, 1, 2…) in footer and on the dashboard. // The event start date has to be set for it to appear. - 'enable_show_day_of_event' => false, + 'enable_show_day_of_event' => (bool) env('ENABLE_SHOW_DAY_OF_EVENT', false), // If true there will be a day 0 (-1, 0, 1…). If false there won't (-1, 1…) - 'event_has_day0' => true, + 'event_has_day0' => (bool) env('EVENT_HAS_DAY0', true), 'metrics' => [ // User work buckets in seconds diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index c1893f5c..ac80cb70 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -385,10 +385,10 @@ function admin_active() : __('Goodie score') )] : []), [ - 'active' => __('Active?'), + 'active' => __('Active'), ], (config('enable_force_active') ? ['force_active' => __('Forced'),] : []), - ($goodie_enabled ? ['tshirt' => ($goodie_tshirt ? __('T-shirt?') : __('Goodie?'))] : []), + ($goodie_enabled ? ['tshirt' => ($goodie_tshirt ? __('T-shirt') : __('Goodie'))] : []), [ 'actions' => __('general.actions'), ] diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index 8ab9a358..02f790c0 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -306,7 +306,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange $member->name = User_Nick_render($member) . User_Pronoun_render($member); if (config('enable_dect')) { $member['dect'] = - sprintf('%1$s', htmlspecialchars($member->contact->dect)); + sprintf('%1$s', htmlspecialchars((string) $member->contact->dect)); } if (config('driving_license_enabled') && $angeltype->requires_driver_license) { $drive_confirmed = $member->license->drive_confirmed; diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 081ccd0f..6d47afdc 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -545,14 +545,14 @@ msgstr "Länge" msgid "Length (in minutes)" msgstr "Länge (in Minuten)" -msgid "Active?" -msgstr "Aktiv?" +msgid "Active" +msgstr "Aktiv" msgid "Forced" msgstr "Erzwungen" -msgid "T-shirt?" -msgstr "T-Shirt?" +msgid "T-shirt" +msgstr "T-Shirt" msgid "T-shirt statistic" msgstr "T-Shirt Statistik" @@ -1170,9 +1170,6 @@ msgstr "Gutschein" msgid "Freeloads" msgstr "Schwänzereien" -msgid "T-shirt" -msgstr "T-Shirt" - msgid "Last login" msgstr "Letzter Login" @@ -1366,9 +1363,6 @@ msgstr "Goodie entfernen" msgid "Got goodie" msgstr "Goodie bekommen" -msgid "Goodie?" -msgstr "Goodie?" - msgid "Angel has got a goodie." msgstr "Engel hat ein Goodie bekommen." @@ -1805,7 +1799,7 @@ msgid "settings.api.about" msgstr "" "Die API erlaubt es dir, über externe Programme, mit dem %s zu interagieren. " "Sie ist noch nicht vollständig, wir arbeiten aber daran sie zu erweitern.\n" -"Der Einstiegspunkt der API befindet sich unter `%s` und ist in der [OpenAPI Spezifikation](%s) beschrieben.\n" +"Der Einstiegspunkt der API befindet sich unter `%s` und ist in der [OpenAPI Spezifikation](%s) beschrieben." msgid "settings.api.about.warning" msgstr "" diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index 52313284..e9253827 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -524,7 +524,7 @@ msgid "settings.api.about" msgstr "" "The API allows you to interact with the %s by using external programs. " "It's not complete but we are working on extending it.\n" -"The endpoint of the API is located at `%s` and described in the [OpenAPI specification](%s).\n" +"The endpoint of the API is located at `%s` and described in the [OpenAPI specification](%s)." msgid "settings.api.about.warning" msgstr "" @@ -820,7 +820,7 @@ msgid "general.created_at" msgstr "Created at" msgid "shifts.random" -msgstr "Zufällige Schicht" +msgstr "Random shift" msgid "shifts.history" msgstr "Shifts history"