diff --git a/lib/towerops_web/live/user_settings_live/session_manager.ex b/lib/towerops_web/live/user_settings_live/session_manager.ex index 8f752ddd..dd3c43e2 100644 --- a/lib/towerops_web/live/user_settings_live/session_manager.ex +++ b/lib/towerops_web/live/user_settings_live/session_manager.ex @@ -2,6 +2,9 @@ defmodule ToweropsWeb.UserSettingsLive.SessionManager do @moduledoc """ Handles browser session and mobile device session management. """ + use Gettext, backend: ToweropsWeb.Gettext + + import ToweropsWeb.GettextHelpers alias Towerops.Accounts alias Towerops.MobileSessions @@ -13,11 +16,11 @@ defmodule ToweropsWeb.UserSettingsLive.SessionManager do case MobileSessions.revoke_session(session_id) do {:ok, _} -> socket - |> Phoenix.LiveView.put_flash(:info, "Mobile device removed successfully.") + |> Phoenix.LiveView.put_flash(:info, t_auth("Mobile device removed successfully.")) |> assign_mobile_sessions() {:error, _} -> - Phoenix.LiveView.put_flash(socket, :error, "Failed to remove mobile device.") + Phoenix.LiveView.put_flash(socket, :error, t_auth("Failed to remove mobile device.")) end end @@ -29,14 +32,14 @@ defmodule ToweropsWeb.UserSettingsLive.SessionManager do case MobileSessions.update_alert_preferences(session_id, %{alerts_enabled: enabled_bool}) do {:ok, _} -> - message = if enabled_bool, do: "Alerts enabled for device", else: "Alerts disabled for device" + message = if enabled_bool, do: t_auth("Alerts enabled for device"), else: t_auth("Alerts disabled for device") socket |> Phoenix.LiveView.put_flash(:info, message) |> assign_mobile_sessions() {:error, _} -> - Phoenix.LiveView.put_flash(socket, :error, "Failed to update alert preferences.") + Phoenix.LiveView.put_flash(socket, :error, t_auth("Failed to update alert preferences.")) end end diff --git a/lib/towerops_web/user_auth.ex b/lib/towerops_web/user_auth.ex index 8374ecca..adc36ff8 100644 --- a/lib/towerops_web/user_auth.ex +++ b/lib/towerops_web/user_auth.ex @@ -656,7 +656,7 @@ defmodule ToweropsWeb.UserAuth do socket = socket |> Phoenix.Component.assign(:policies_needing_consent, []) - |> LiveView.put_flash(:info, "Thank you for accepting the updated policies.") + |> LiveView.put_flash(:info, t_auth("Thank you for accepting the updated policies.")) {:halt, socket} diff --git a/priv/gettext/auth.pot b/priv/gettext/auth.pot index 4107a9b6..165d03c4 100644 --- a/priv/gettext/auth.pot +++ b/priv/gettext/auth.pot @@ -212,3 +212,81 @@ msgstr "" #, elixir-autogen, elixir-format msgid "✓ Real-time alerts and notifications" msgstr "" + +#: lib/towerops_web/live/user_settings_live/session_manager.ex:35 +#, elixir-autogen, elixir-format +msgid "Alerts disabled for device" +msgstr "" + +#: lib/towerops_web/live/user_settings_live/session_manager.ex:35 +#, elixir-autogen, elixir-format +msgid "Alerts enabled for device" +msgstr "" + +#: lib/towerops_web/live/user_settings_live/session_manager.ex:23 +#, elixir-autogen, elixir-format +msgid "Failed to remove mobile device." +msgstr "" + +#: lib/towerops_web/live/user_settings_live/session_manager.ex:42 +#, elixir-autogen, elixir-format +msgid "Failed to update alert preferences." +msgstr "" + +#: lib/towerops_web/live/user_settings_live/session_manager.ex:19 +#, elixir-autogen, elixir-format +msgid "Mobile device removed successfully." +msgstr "" + +#: lib/towerops_web/user_auth.ex:440 +#: lib/towerops_web/user_auth.ex:447 +#: lib/towerops_web/user_auth.ex:512 +#: lib/towerops_web/user_auth.ex:521 +#, elixir-autogen, elixir-format +msgid "Organization not found." +msgstr "" + +#: lib/towerops_web/user_auth.ex:292 +#: lib/towerops_web/user_auth.ex:571 +#, elixir-autogen, elixir-format +msgid "Please verify your identity to continue." +msgstr "" + +#: lib/towerops_web/user_auth.ex:659 +#, elixir-autogen, elixir-format +msgid "Thank you for accepting the updated policies." +msgstr "" + +#: lib/towerops_web/user_auth.ex:299 +#: lib/towerops_web/user_auth.ex:579 +#, elixir-autogen, elixir-format +msgid "Two-factor authentication is required for this action." +msgstr "" + +#: lib/towerops_web/user_auth.ex:434 +#: lib/towerops_web/user_auth.ex:504 +#, elixir-autogen, elixir-format +msgid "You don't have access to this organization." +msgstr "" + +#: lib/towerops_web/user_auth.ex:365 +#: lib/towerops_web/user_auth.ex:550 +#, elixir-autogen, elixir-format +msgid "You must be a superuser to access this page." +msgstr "" + +#: lib/towerops_web/user_auth.ex:618 +#, elixir-autogen, elixir-format +msgid "You must be an organization owner to access this page." +msgstr "" + +#: lib/towerops_web/user_auth.ex:348 +#: lib/towerops_web/user_auth.ex:482 +#, elixir-autogen, elixir-format +msgid "You must log in to access this page." +msgstr "" + +#: lib/towerops_web/user_auth.ex:600 +#, elixir-autogen, elixir-format +msgid "You must set up two-factor authentication to continue." +msgstr ""