chore: refactored the UI locale handling

This commit is contained in:
2026-05-01 15:58:55 +02:00
parent 62e44150b3
commit 296a57814f
36 changed files with 114 additions and 40 deletions

View File

@@ -4,10 +4,11 @@ defmodule BDS.Desktop.ShellLive.SidebarComponents do
use Phoenix.Component
alias BDS.Desktop.ShellData
alias BDS.Desktop.UILocale
alias BDS.UI.Registry
def sidebar_content(assigns) do
Process.put(:bds_ui_locale, assigns.page_language)
UILocale.put(assigns.page_language)
assigns = prepare_filter_assigns(assigns)
~H"""
@@ -462,7 +463,7 @@ defmodule BDS.Desktop.ShellLive.SidebarComponents do
"""
end
defp translated(text, bindings \\ %{}), do: ShellData.translate(text, bindings, Process.get(:bds_ui_locale))
defp translated(text, bindings \\ %{}), do: ShellData.translate(text, bindings, BDS.Desktop.UILocale.current())
defp template_sidebar?(sidebar_data), do: Map.get(sidebar_data, :title) == "Templates"