feat: domain event bus for multi-client sync (issue #26, phase 2)

This commit is contained in:
2026-07-14 19:33:07 +02:00
parent 700ed79c43
commit 16f45d77b2
14 changed files with 309 additions and 10 deletions

View File

@@ -62,10 +62,23 @@ defmodule BDS.I18n do
def resolve_ui_locale(locale), do: resolve_supported_locale(locale) || @default_language
def current_ui_locale do
(System.get_env("LC_ALL") || System.get_env("LC_MESSAGES") || System.get_env("LANG"))
(stored_ui_locale() || System.get_env("LC_ALL") || System.get_env("LC_MESSAGES") ||
System.get_env("LANG"))
|> resolve_ui_locale()
end
# The UI language is a server-side setting shared by all connected clients
# (issue #26); the OS locale is only the fallback for a fresh install.
defp stored_ui_locale do
with true <- BDS.Repo.ready?(),
value when is_binary(value) and value != "" <-
BDS.Settings.get_global_setting("ui.language") do
value
else
_other -> nil
end
end
def resolve_render_locale(language), do: resolve_supported_locale(language) || @default_language
def format_locale(language) do