feat: complete change to gettext from homebrew i18n solution

This commit is contained in:
2026-05-03 22:28:25 +02:00
parent 4bee8cf1db
commit 4de8492c4f
96 changed files with 21579 additions and 1497 deletions

View File

@@ -3,7 +3,7 @@ defmodule BDS.Desktop.ShellLive.ChatSurface do
import Phoenix.Component, only: [assign: 3]
alias BDS.Desktop.ShellData
use Gettext, backend: BDS.Gettext
def assistant_turn(prompt, socket) do
[
@@ -12,12 +12,12 @@ defmodule BDS.Desktop.ShellLive.ChatSurface do
]
end
def assistant_project_name(nil), do: translated("Projects")
def assistant_project_name(nil), do: dgettext("ui", "Projects")
def assistant_project_name(project), do: project.name
def assistant_message_label("assistant"), do: translated("Assistant")
def assistant_message_label("user"), do: translated("You")
def assistant_message_label(_role), do: translated("Assistant")
def assistant_message_label("assistant"), do: dgettext("ui", "Assistant")
def assistant_message_label("user"), do: dgettext("ui", "You")
def assistant_message_label(_role), do: dgettext("ui", "Assistant")
def assistant_message_testid(role), do: "assistant-message-#{role}"
@@ -30,19 +30,9 @@ defmodule BDS.Desktop.ShellLive.ChatSurface do
defp assistant_reply(socket) do
if socket.assigns.offline_mode do
ShellData.translate(
"Automatic AI actions stay gated by airplane mode.",
%{},
socket.assigns.page_language
)
BDS.Gettext.lgettext(socket.assigns.page_language, "ui", "Automatic AI actions stay gated by airplane mode.")
else
ShellData.translate(
"The assistant sidebar chat surface is ready, but model execution is not connected yet.",
%{},
socket.assigns.page_language
)
BDS.Gettext.lgettext(socket.assigns.page_language, "ui", "The assistant sidebar chat surface is ready, but model execution is not connected yet.")
end
end
defp translated(text), do: ShellData.translate(text, %{}, BDS.Desktop.UILocale.current())
end