From 990ba95f5ed852306cca16c14e0f41dff4a654a0 Mon Sep 17 00:00:00 2001 From: Peddn Date: Sun, 31 Aug 2025 13:51:12 +0200 Subject: [PATCH] =?UTF-8?q?The=20tag=20=E2=80=9Cclosed=E2=80=9D=20or=20its?= =?UTF-8?q?=20translated=20version=20is=20now=20automatically=20added=20to?= =?UTF-8?q?=20the=20tag=20tuple=20if=20it=20has=20not=20already=20been=20s?= =?UTF-8?q?pecified=20in=20=E2=80=9Csettings.py=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current behavior: If the tag 'closed' is not set in INGAME_REPORT_STATUS_TAGS, reports can no longer be closed, which seems like a bug to me. An alternative solution would be another setting in ‘settings.py’, such as ‘INGAME_REPORT_STATUS_CLOSED_TAG’. This would also eliminate the need for internationalization, as the tag could be set in the desired language. --- .../base_systems/ingame_reports/menu.py | 25 +++++++++--------- evennia/locale/de/LC_MESSAGES/django.mo | Bin 19145 -> 19146 bytes evennia/locale/de/LC_MESSAGES/django.po | 13 +++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/evennia/contrib/base_systems/ingame_reports/menu.py b/evennia/contrib/base_systems/ingame_reports/menu.py index 044065e84..fb25e55bb 100644 --- a/evennia/contrib/base_systems/ingame_reports/menu.py +++ b/evennia/contrib/base_systems/ingame_reports/menu.py @@ -12,6 +12,7 @@ from evennia.utils.utils import crop, datetime_format, is_iter, iter_to_str # the number of reports displayed on each page _REPORTS_PER_PAGE = 10 +# the fallback standard tags _REPORT_STATUS_TAGS = ("in progress", "rejected") # the tag, used to mark a report as 'closed' _REPORT_STATUS_CLOSED_TAG = _("closed") @@ -23,8 +24,9 @@ if hasattr(settings, "INGAME_REPORT_STATUS_TAGS"): logger.log_warn( "The 'INGAME_REPORT_STATUS_TAGS' setting must be an iterable of strings; falling back to defaults." ) -# add the tag to the tag tupel -_REPORT_STATUS_TAGS = _REPORT_STATUS_TAGS + (_REPORT_STATUS_CLOSED_TAG,) +# add the 'closed' tag to the tupel of tags +if _REPORT_STATUS_CLOSED_TAG not in _REPORT_STATUS_TAGS: + _REPORT_STATUS_TAGS = _REPORT_STATUS_TAGS + (_REPORT_STATUS_CLOSED_TAG,) def menunode_list_reports(caller, raw_string, **kwargs): @@ -164,15 +166,14 @@ def menunode_manage_report(caller, raw_string, report, **kwargs): options = [] for tag in _REPORT_STATUS_TAGS: if tag in report.tags.all(): - if tag in report.tags.all(): - desc = _("Unmark as {tag}").format(tag=tag) - else: - desc = _("Mark as {tag}").format(tag=tag) - options.append( - { - "desc": desc, - "goto": (_report_toggle_tag, {"report": report, "tag": tag}), - } - ) + desc = _("Unmark as {tag}").format(tag=tag) + else: + desc = _("Mark as {tag}").format(tag=tag) + options.append( + { + "desc": desc, + "goto": (_report_toggle_tag, {"report": report, "tag": tag}), + } + ) options.append({"desc": _("Manage another report"), "goto": "menunode_list_reports"}) return text, options diff --git a/evennia/locale/de/LC_MESSAGES/django.mo b/evennia/locale/de/LC_MESSAGES/django.mo index d2370b7cfc38d317cd45322ac5af5090719b57fe..f898842d8249340110ce47745be76325ddb1e8c8 100644 GIT binary patch delta 1075 zcmXZbPe@cz6vy%3Bc0MRNXx-#l(8{}Y7+mHj;S@8<&;EbGa0EM5m6xRqCu#)5h{YP zKLeG}q9olF3}TBm(jpRCSh)xxB6U%;YFPw*kMFHM_n!OboqO+j?{m(4&UuwCbW0^o z)=8B(i<@u}gZLdc;vYPTfqH2hp22H4g6nYwcjGUNW3Yia*o9%7z#aG+OK=Ix@JEB( zwF&piegbp27b}{j2zKLEyo7c`*U>Vcz(@EJyD`PCK^#XLpGHgg4TkU=w&P#i zf-PiKjy*07TX-I0IO_WhN9fPvM{MSLj$<*$<`Bx@S-gX_xPlw7tW7$MVYCwt;~?g6 z7yd>|EKD|REjLM{ipD5b;A0%aJX&IjgWj9>qV+FgDcFd1nq5Su>*f%4aVu%_$jph6{Jk`0IgWxA$6!v zxE%{SB?qg~ZYYWc7+;IKO!fnfXc;DO7(0ERBhRJ+?zIZr(Vl7$`7tzxQJlf2_yu#A z?eY$=`H0j@zXN;lK4$SNUgi7hKPnC32fToLsHh~4qZQKv+DTT?PUxh(zoi7(Ln+_8 z*hl{}TG7UiQHa=vcC)K!Pgp}CMJ$e$)ij1^*aFudco@U>AMSce-EQW#sX5HF(L&~>!Thj0+zUmNSY!0Cep2GXM9hYz&7Bq0}7(zSY8SKHQ zSdG8Y5(|+HTgz#rQ9+|0gE)w{@f})XiT&=Ix1;qhU;*Cn;t$boYy`V;4m&W~=U3#9IRc5J7nqwVrUsA@GLfazC@l)tGU+-Y(RUeZsf<%EsWqeKF6<^ z#oj~i0rC!$Ed3^I!$;VM3wVw1tFuKqjbHFQ)})w>18BuGjdqe{v=i!x`?usGdno1k z0Mqnm(TaBKQRy`%(QbAb?Fl0kQrO~HzKKQ;4O?*28+hXN$Hy)Ol2v2F(JiI_0a_1% AasU7T diff --git a/evennia/locale/de/LC_MESSAGES/django.po b/evennia/locale/de/LC_MESSAGES/django.po index c9dd9a743..1bf7ff9e5 100644 --- a/evennia/locale/de/LC_MESSAGES/django.po +++ b/evennia/locale/de/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-31 09:56+0000\n" +"POT-Creation-Date: 2025-08-31 10:23+0000\n" "PO-Revision-Date: 2025-03-28 10:21+0100\n" "Last-Translator: \n" "Language-Team: \n" @@ -353,8 +353,7 @@ msgstr "{hub_name} verwalten" msgid "" "(No {status} reports)\n" "{text}" -msgstr "Keine {status} Berichte" -"{text}" +msgstr "Keine {status} Berichte{text}" #: contrib/base_systems/ingame_reports/menu.py:52 #, python-brace-format @@ -411,7 +410,7 @@ msgstr "Alle offenen Berichte" #: contrib/base_systems/ingame_reports/menu.py:148 #, python-brace-format msgid " about {receivers}" -msgstr "über {receivers}" +msgstr " über {receivers}" #: contrib/base_systems/ingame_reports/menu.py:153 #, python-brace-format @@ -424,17 +423,17 @@ msgstr "" "{timestamp} von {senders}{about_clause}\n" "{tags}" -#: contrib/base_systems/ingame_reports/menu.py:168 +#: contrib/base_systems/ingame_reports/menu.py:167 #, python-brace-format msgid "Unmark as {tag}" msgstr "Markierung als {tag} entfernen" -#: contrib/base_systems/ingame_reports/menu.py:170 +#: contrib/base_systems/ingame_reports/menu.py:169 #, python-brace-format msgid "Mark as {tag}" msgstr "Als {tag} markieren" -#: contrib/base_systems/ingame_reports/menu.py:177 +#: contrib/base_systems/ingame_reports/menu.py:176 msgid "Manage another report" msgstr "Einen anderen Bericht verwalten."