From ecc3976c27decdddc4dd9a4ccfae444614b835fa Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Fri, 10 Nov 2023 16:20:01 +0100 Subject: [PATCH] Show specific error message titles --- resources/lang/de_DE/default.po | 15 +++++++++++++++ resources/lang/en_US/default.po | 15 +++++++++++++++ resources/views/admin/locations/edit.twig | 2 +- resources/views/admin/locations/index.twig | 6 +++++- resources/views/pages/faq/edit.twig | 2 +- resources/views/pages/faq/overview.twig | 4 ++-- resources/views/pages/news/edit.twig | 2 +- resources/views/pages/news/news.twig | 6 +++++- resources/views/pages/news/overview.twig | 2 +- resources/views/pages/questions/edit.twig | 2 +- resources/views/pages/questions/overview.twig | 6 +++++- 11 files changed, 52 insertions(+), 10 deletions(-) diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 6134dd18..c9929b2a 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -1593,6 +1593,12 @@ msgstr "Nachricht" msgid "news.edit.hint" msgstr "Du kannst Markdown und den [more] Tag benutzen" +msgid "news.delete.title" +msgstr "News \"%s\" löschen" + +msgid "news.comments.delete.title" +msgstr "Kommentar \"%s\" löschen" + msgid "form.search" msgstr "Suchen" @@ -1841,6 +1847,9 @@ msgstr "Frage" msgid "faq.message" msgstr "Antwort" +msgid "faq.delete.title" +msgstr "FAQ \"%s\" löschen" + msgid "question.questions" msgstr "Fragen" @@ -1859,6 +1868,9 @@ msgstr "Frage" msgid "question.answer" msgstr "Antwort" +msgid "question.delete.title" +msgstr "Frage \"%s\" löschen" + msgid "user.edit.shirt" msgstr "Shirt bearbeiten" @@ -1969,6 +1981,9 @@ msgstr "Ort erstellen" msgid "location.edit.title" msgstr "Ort bearbeiten" +msgid "location.delete.title" +msgstr "Ort \"%s\" löschen" + msgid "event.day" msgstr "Tag %1$d" diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index 3ec07cef..c531b80d 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -211,6 +211,12 @@ msgstr "Message" msgid "news.edit.hint" msgstr "You can use Markdown and the [more] tag" +msgid "news.delete.title" +msgstr "Delete news \"%s\"" + +msgid "news.comments.delete.title" +msgstr "Delete comment \"%s\"" + msgid "form.search" msgstr "Search" @@ -459,6 +465,9 @@ msgstr "Question" msgid "faq.message" msgstr "Answer" +msgid "faq.delete.title" +msgstr "Delete FAQ \"%s\"" + msgid "question.questions" msgstr "Questions" @@ -477,6 +486,9 @@ msgstr "Question" msgid "question.answer" msgstr "Answer" +msgid "question.delete.title" +msgstr "Delete question \"%s\"" + msgid "user.edit.shirt" msgstr "Edit shirt" @@ -604,6 +616,9 @@ msgstr "Create location" msgid "location.edit.title" msgstr "Edit location" +msgid "location.delete.title" +msgstr "Delete location \"%s\"" + msgid "event.day" msgstr "Day %1$d" diff --git a/resources/views/admin/locations/edit.twig b/resources/views/admin/locations/edit.twig index c3cb4799..f30fb437 100644 --- a/resources/views/admin/locations/edit.twig +++ b/resources/views/admin/locations/edit.twig @@ -57,7 +57,7 @@
{{ f.submit(__('form.save'), {'icon_left': 'save'}) }} {% if location %} - {{ f.delete(__('form.delete'), {'confirm_title': location.name|e}) }} + {{ f.delete(__('form.delete'), {'confirm_title': __('location.delete.title', [location.name|e])}) }} {% endif %}
diff --git a/resources/views/admin/locations/index.twig b/resources/views/admin/locations/index.twig index 1df7cad4..c5da1425 100644 --- a/resources/views/admin/locations/index.twig +++ b/resources/views/admin/locations/index.twig @@ -57,7 +57,11 @@
{{ csrf() }} {{ f.hidden('id', location.id) }} - {{ f.delete(null, {'size': 'sm','confirm_title': location.name|e}) }} + {{ f.delete(null, { + 'size': 'sm', + 'confirm_title': __('location.delete.title', [location.name|e]), + 'confirm_button_text': __('form.delete'), + }) }}
diff --git a/resources/views/pages/faq/edit.twig b/resources/views/pages/faq/edit.twig index 1ceec08c..395e9d25 100644 --- a/resources/views/pages/faq/edit.twig +++ b/resources/views/pages/faq/edit.twig @@ -51,7 +51,7 @@ {{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} {% if faq and faq.id %} - {{ f.delete(__('form.delete'), {'confirm_title': faq.question[:40]|e})}} + {{ f.delete(__('form.delete'), {'confirm_title': __('faq.delete.title', [faq.question[:40]|e])})}} {% endif %} diff --git a/resources/views/pages/faq/overview.twig b/resources/views/pages/faq/overview.twig index bc5d651c..38f4019f 100644 --- a/resources/views/pages/faq/overview.twig +++ b/resources/views/pages/faq/overview.twig @@ -66,8 +66,8 @@ {{ csrf() }} {{ f.delete(null, { 'size': 'sm', - 'confirm_title': item.question[:40]|e, - 'confirm_button_text': __('form.delete') + 'confirm_title': __('faq.delete.title', [item.question[:40]|e]), + 'confirm_button_text': __('form.delete'), }) }} {% endif %} diff --git a/resources/views/pages/news/edit.twig b/resources/views/pages/news/edit.twig index a944eec8..3299698c 100644 --- a/resources/views/pages/news/edit.twig +++ b/resources/views/pages/news/edit.twig @@ -75,7 +75,7 @@ {{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} {% if news and news.id %} - {{ f.delete(__('form.delete'), {'confirm_title': news.title[:40]|e}) }} + {{ f.delete(__('form.delete'), {'confirm_title': __('news.delete.title', [news.title[:40]|e])}) }} {% endif %} diff --git a/resources/views/pages/news/news.twig b/resources/views/pages/news/news.twig index 322ba717..cea15b22 100644 --- a/resources/views/pages/news/news.twig +++ b/resources/views/pages/news/news.twig @@ -33,7 +33,11 @@ action="{{ url('/news/comment/' ~ comment.id) }}" enctype="multipart/form-data" method="post"> {{ csrf() }} - {{ f.delete(null, {'size': 'sm', 'confirm_title': comment.text[:40]|e}) }} + {{ f.delete(null, { + 'size': 'sm', + 'confirm_title': __('news.comments.delete.title', [comment.text[:40]|e]), + 'confirm_button_text': __('form.delete'), + }) }} {% endif %} diff --git a/resources/views/pages/news/overview.twig b/resources/views/pages/news/overview.twig index ce0a9a36..99542e91 100644 --- a/resources/views/pages/news/overview.twig +++ b/resources/views/pages/news/overview.twig @@ -104,7 +104,7 @@ {{ csrf() }} {{ f.delete(null, { 'size': 'sm', - 'confirm_title': news.title[:40]|e, + 'confirm_title': __('news.delete.title', [news.title[:40]|e]), 'confirm_button_text': __('form.delete') }) }} diff --git a/resources/views/pages/questions/edit.twig b/resources/views/pages/questions/edit.twig index 61cc926f..b794a987 100644 --- a/resources/views/pages/questions/edit.twig +++ b/resources/views/pages/questions/edit.twig @@ -52,7 +52,7 @@ {% if is_admin|default(false) %} {{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} {% if question and question.id %} - {{ f.delete(__('form.delete'), {'confirm_title': question.text[:40]|e}) }} + {{ f.delete(__('form.delete'), {'confirm_title': __('question.delete.title', [question.text[:40]|e])}) }} {% endif %} {% endif %} diff --git a/resources/views/pages/questions/overview.twig b/resources/views/pages/questions/overview.twig index 5e86863e..e0d89886 100644 --- a/resources/views/pages/questions/overview.twig +++ b/resources/views/pages/questions/overview.twig @@ -53,7 +53,11 @@
{{ csrf() }} {{ f.hidden('id', question.id) }} - {{ f.delete(null, {'size': 'sm', 'confirm_title': question.text[:40]|e, 'confirm_button_text': __('form.delete')}) }} + {{ f.delete(null, { + 'size': 'sm', + 'confirm_title': __('question.delete.title', [question.text[:40]|e]), + 'confirm_button_text': __('form.delete'), + }) }}
{% endif %}