Skip to content

Commit

Permalink
feat(filters): replace English help_texts
Browse files Browse the repository at this point in the history
Replace English (portions of) help_texts of filters
inherited from AbstractEntityFilterSet with German
wordings. Applies to 'changed_since' and generic
'search' fields specifically.
  • Loading branch information
koeaw committed Sep 16, 2024
1 parent 0ec166e commit d6166a8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions apis_ontology/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,21 @@ class Meta(AbstractEntityFilterSet.Meta):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if "custom_search" in self.filters:
self.filters.move_to_end("custom_search", False)

if getattr(self.Meta, "model", False):
if "search" in self.filters:
self.filters["search"].label = "Allgemeine Suche"

if help_text := self.filters["search"].extra.get("help_text"):
self.filters["search"].extra["help_text"] = (
f'Suche in den Textfeldern: {help_text.split(":")[1]}'
)

if "changed_since" in self.filters:
self.filters["changed_since"].label = "Geändert seit:"

if "custom_search" in self.filters:
self.filters.move_to_end("custom_search", False)


class LanguageMixinFilter(django_filters.FilterSet):
Expand Down

0 comments on commit d6166a8

Please sign in to comment.