From 7a8d7be3e27dbc4cd03846f1a357843bad325d11 Mon Sep 17 00:00:00 2001 From: Lucas Brandstaetter <lucas@brandstaetter.tech> Date: Sat, 7 Dec 2024 01:43:51 +0100 Subject: [PATCH] Update translation keys in core The translation keys have been updated to use split words with underscores, this allows cspell to recognize them as separate words. --- src/core/forms/authentication.py | 2 +- src/core/locale/de/LC_MESSAGES/django.po | 16 ++++++++-------- src/core/locale/en/LC_MESSAGES/django.po | 14 +++++++------- src/core/models/conference.py | 4 ++-- src/core/models/metanavi.py | 2 +- src/core/models/pages.py | 2 +- src/core/models/rooms.py | 2 +- src/core/models/voucher.py | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/core/forms/authentication.py b/src/core/forms/authentication.py index 15a3a9cc2..1bb549771 100644 --- a/src/core/forms/authentication.py +++ b/src/core/forms/authentication.py @@ -128,7 +128,7 @@ class RegistrationForm(UserCreationForm): if self.request and self.request.limited: raise ValidationError(_('Registration__rate-limited')) if (username := self.cleaned_data.get('username')) and username.startswith('_'): - raise ValidationError({'username': _('Registration__username__nounderscore')}) + raise ValidationError({'username': _('Registration__username__no_underscore')}) return super().clean() def send_mail( diff --git a/src/core/locale/de/LC_MESSAGES/django.po b/src/core/locale/de/LC_MESSAGES/django.po index 78a8c3466..d64fb8805 100644 --- a/src/core/locale/de/LC_MESSAGES/django.po +++ b/src/core/locale/de/LC_MESSAGES/django.po @@ -131,7 +131,7 @@ msgstr "Deine Kontakt Email für diese Veranstaltung (nicht öffentlich)" msgid "Registration__rate-limited" msgstr "Zu viele Request (Rate-Limited), bitte einen Moment warten!" -msgid "Registration__username__nounderscore" +msgid "Registration__username__no_underscore" msgstr "Der Benutzername darf nicht mit einem Unterstrich beginnen." msgid "Conference__is_public__unchangeable" @@ -463,7 +463,7 @@ msgid "AssemblyMember__is_technical_contact__help" msgstr "Ansprechperson für technische Fragen der Vor-Ort-Assembly, z.B. Strom und Netzwerk" msgid "AssemblyMember__is_technical_contact" -msgstr "techn. Ansprechperson" +msgstr "technische Ansprechperson" msgid "AssemblyMember__show_public__help" msgstr "Zugehörigkeit öffentlich anzeigen?" @@ -829,10 +829,10 @@ msgstr "Standard-Bild für Veranstaltungen in diesem Track wenn diese kein eigen msgid "ConferenceTrack__banner_image" msgstr "Standard-Banner" -msgid "ConferenceNavigationItem__url__missingseparator" +msgid "ConferenceNavigationItem__url__missing_separator" msgstr "Dies ist keine URL (es fehlt '://')." -msgid "ConferenceNavigationItem__url__supportedprotocols" +msgid "ConferenceNavigationItem__url__supported_protocols" msgstr "Nicht unterstütztes Protokoll - unterstützt werden: " msgid "ConferenceNavigationItem" @@ -1422,7 +1422,7 @@ msgstr "Ziel des Links beim Klicken des Eintrags" msgid "MetaNavItem__url" msgstr "URL" -msgid "MetaNavItem__url__requiredabsolute" +msgid "MetaNavItem__url__required_absolute" msgstr "Die URL muss absolut sein, relative URLs ergeben keinen Sinn für die Meta-Navigation!" msgid "MetaNavItem__url__necessary_when_shown" @@ -1539,7 +1539,7 @@ msgstr "Wiki-Seite" msgid "StaticPages" msgstr "Wiki-Seiten" -msgid "StaticPage__public_revision__notfound" +msgid "StaticPage__public_revision__not_found" msgstr "Die angegebene Revision existiert nicht oder gehört nicht zu dieser Seite." msgid "StaticPageRevision__title__help" @@ -1825,7 +1825,7 @@ msgstr "Es ergibt keinen Sinn, die Option \"alle Assemblies\" mit der Auswahl ei msgid "RoomShare__at_least_one_option" msgstr "Es muss mindestens ein Freigabe-Ziel (einzelne Assembly, alle Assemblies und/oder Self-Organized-Sessions) ausgewählt werden." -msgid "RoomLink__link__mustbeurl" +msgid "RoomLink__link__must_be_url" msgstr "Das Link-Ziel muss eine gültige URL sein." msgid "ScheduleSource__import_type__help" @@ -2372,7 +2372,7 @@ msgstr "Zeitpunkt wann die Zuordnung stattgefunden hat" msgid "VoucherEntry__assigned" msgstr "zugeordnet" -msgid "VoucherEntry__assigned__needtarget" +msgid "VoucherEntry__assigned__need_target" msgstr "Es ist eine Zuordnung (Assembly/Channel/Nutzer) notwendig wenn ein Zeitpunkt gesetzt werden soll!" msgid "VoucherEntry__already_assigned" diff --git a/src/core/locale/en/LC_MESSAGES/django.po b/src/core/locale/en/LC_MESSAGES/django.po index 85ac8ddc2..608a666a7 100644 --- a/src/core/locale/en/LC_MESSAGES/django.po +++ b/src/core/locale/en/LC_MESSAGES/django.po @@ -131,7 +131,7 @@ msgstr "Your contact email for this event (not public)" msgid "Registration__rate-limited" msgstr "Too many requests (Rate-Limited), please wait a moment!" -msgid "Registration__username__nounderscore" +msgid "Registration__username__no_underscore" msgstr "The username must not begin with an underscore." msgid "Conference__is_public__unchangeable" @@ -829,10 +829,10 @@ msgstr "representational image for events in this track which do not provide the msgid "ConferenceTrack__banner_image" msgstr "default banner" -msgid "ConferenceNavigationItem__url__missingseparator" +msgid "ConferenceNavigationItem__url__missing_separator" msgstr "This is not an URL (you are missing '://')." -msgid "ConferenceNavigationItem__url__supportedprotocols" +msgid "ConferenceNavigationItem__url__supported_protocols" msgstr "Unsupported protocol, supported are: " msgid "ConferenceNavigationItem" @@ -1422,7 +1422,7 @@ msgstr "target URL" msgid "MetaNavItem__url" msgstr "URL" -msgid "MetaNavItem__url__requiredabsolute" +msgid "MetaNavItem__url__required_absolute" msgstr "The URL must be absolute, a relative URL does not make sense in the meta-navigation!" msgid "MetaNavItem__url__necessary_when_shown" @@ -1539,7 +1539,7 @@ msgstr "wiki page" msgid "StaticPages" msgstr "wiki pages" -msgid "StaticPage__public_revision__notfound" +msgid "StaticPage__public_revision__not_found" msgstr "The revision could not be found or is not associated with this page." msgid "StaticPageRevision__title__help" @@ -1823,7 +1823,7 @@ msgstr "It does not make sense to combine the options \"all assemblies\" with th msgid "RoomShare__at_least_one_option" msgstr "You must choose at least one share recipient (single assembly, all assemblies and/or self-organized sessions)." -msgid "RoomLink__link__mustbeurl" +msgid "RoomLink__link__must_be_url" msgstr "The link target must be a URL." msgid "ScheduleSource__import_type__help" @@ -2370,7 +2370,7 @@ msgstr "when was this voucher entry assigned to the target" msgid "VoucherEntry__assigned" msgstr "assigned" -msgid "VoucherEntry__assigned__needtarget" +msgid "VoucherEntry__assigned__need_target" msgstr "Need an assigned target when setting an 'assigned' timestamp." msgid "VoucherEntry__already_assigned" diff --git a/src/core/models/conference.py b/src/core/models/conference.py index 96e19c112..02c7c5393 100644 --- a/src/core/models/conference.py +++ b/src/core/models/conference.py @@ -828,7 +828,7 @@ class ConferenceExportCache(models.Model): def validate_conferencenavigationitem_url(value: str) -> None: if '://' not in value: - raise ValidationError(_('ConferenceNavigationItem__url__missingseparator')) + raise ValidationError(_('ConferenceNavigationItem__url__missing_separator')) _valid_protocols = ['assembly', 'event', 'conference', 'wiki'] @@ -840,7 +840,7 @@ def validate_conferencenavigationitem_url(value: str) -> None: elif protocol in ['http', 'https']: URLValidator()(value) else: - raise ValidationError(_('ConferenceNavigationItem__url__supportedprotocols') + 'http, https, ' + ', '.join(_valid_protocols)) + raise ValidationError(_('ConferenceNavigationItem__url__supported_protocols') + 'http, https, ' + ', '.join(_valid_protocols)) class ConferenceNavigationItem(models.Model): diff --git a/src/core/models/metanavi.py b/src/core/models/metanavi.py index b03b6b7c4..16369fcb3 100644 --- a/src/core/models/metanavi.py +++ b/src/core/models/metanavi.py @@ -84,7 +84,7 @@ class MetaNavItem(models.Model): if self.url: parsed_url = urlparse(self.url) if not parsed_url.netloc: - errors['url'] = _('MetaNavItem__url__requiredabsolute') + errors['url'] = _('MetaNavItem__url__required_absolute') elif self.visible and self.enabled: errors['url'] = _('MetaNavItem__url__necessary_when_shown') diff --git a/src/core/models/pages.py b/src/core/models/pages.py index 257ca1333..b8b3164ab 100644 --- a/src/core/models/pages.py +++ b/src/core/models/pages.py @@ -334,7 +334,7 @@ class StaticPage(models.Model): try: StaticPageRevision.objects.get(page=self, revision=self.public_revision) except StaticPageRevision.DoesNotExist: - raise ValidationError({'public_revision': _('StaticPage__public_revision__notfound')}) + raise ValidationError({'public_revision': _('StaticPage__public_revision__not_found')}) else: self.search_content = None self.search_vector = None diff --git a/src/core/models/rooms.py b/src/core/models/rooms.py index 3285a9daf..0ab54546a 100644 --- a/src/core/models/rooms.py +++ b/src/core/models/rooms.py @@ -487,7 +487,7 @@ class RoomLink(models.Model): try: validator(self.link) except ValidationError: - raise ValidationError({'link': _('RoomLink__link__mustbeurl')}) + raise ValidationError({'link': _('RoomLink__link__must_be_url')}) def __str__(self): return self.name diff --git a/src/core/models/voucher.py b/src/core/models/voucher.py index 1bd1a2fbf..4d73510e3 100644 --- a/src/core/models/voucher.py +++ b/src/core/models/voucher.py @@ -214,7 +214,7 @@ class VoucherEntry(models.Model): if self.assigned is not None: if self.assigned_assembly is None and self.assigned_user is None: - errors['assigned'] = _('VoucherEntry__assigned__needtarget') + errors['assigned'] = _('VoucherEntry__assigned__need_target') else: # assembly assigned without a timestamp? -- GitLab