authentik icon indicating copy to clipboard operation
authentik copied to clipboard

Add translations to flows stage titles

Open jkolczasty opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. Stage title are not translated now.

Describe the solution you'd like Add translation to flows stage titles

Describe alternatives you've considered Nope, there is no alternative I know.

Additional context

Proposed patch for authentik/flows/stage.py:

*** /original/2023.10/authentik/flows/stage.py  2024-02-13 15:53:58.887145061 +0000
--- /patch/authentik/flows/stage.py     2024-02-13 15:49:45.563823914 +0000
***************
*** 7,12 ****
--- 7,13 ----
  from django.http.response import HttpResponse
  from django.urls import reverse
  from django.views.generic.base import View
+ from django.utils.translation import gettext as _
  from prometheus_client import Histogram
  from rest_framework.request import Request
  from sentry_sdk.hub import Hub
***************
*** 146,154 ****
      def format_title(self) -> str:
          """Allow usage of placeholder in flow title."""
          if not self.executor.plan:
!             return self.executor.flow.title
          try:
!             return self.executor.flow.title % {
                  "app": self.executor.plan.context.get(PLAN_CONTEXT_APPLICATION, ""),
                  "user": self.get_pending_user(for_display=True),
              }
--- 147,155 ----
      def format_title(self) -> str:
          """Allow usage of placeholder in flow title."""
          if not self.executor.plan:
!             return _(self.executor.flow.title)
          try:
!             return _(self.executor.flow.title) % {
                  "app": self.executor.plan.context.get(PLAN_CONTEXT_APPLICATION, ""),
                  "user": self.get_pending_user(for_display=True),
              }

jkolczasty avatar Feb 13 '24 15:02 jkolczasty