diff --git a/lib/towerops_web.ex b/lib/towerops_web.ex index 245232a5..779c2c03 100644 --- a/lib/towerops_web.ex +++ b/lib/towerops_web.ex @@ -43,6 +43,7 @@ defmodule ToweropsWeb do use Gettext, backend: ToweropsWeb.Gettext import Plug.Conn + import ToweropsWeb.GettextHelpers unquote(verified_routes()) end diff --git a/lib/towerops_web/components/layouts.ex b/lib/towerops_web/components/layouts.ex index 21b2af67..717552c1 100644 --- a/lib/towerops_web/components/layouts.ex +++ b/lib/towerops_web/components/layouts.ex @@ -293,12 +293,12 @@ defmodule ToweropsWeb.Layouts do class="inline-flex items-center justify-center gap-x-1 rounded-md bg-white px-2 py-1.5 sm:px-3 sm:py-2 text-xs sm:text-sm font-semibold text-gray-900 shadow-xs inset-ring-1 inset-ring-gray-300 hover:bg-gray-50 dark:bg-white/10 dark:text-white dark:shadow-none dark:inset-ring-white/5 dark:hover:bg-white/20" > {if @current_organization, do: String.slice(@current_organization.name, 0..10), - else: "Menu"} + else: t("Menu")} - Skip to main content + {t("Skip to main content")} {@inner_content} diff --git a/lib/towerops_web/controllers/error_html/404.html.heex b/lib/towerops_web/controllers/error_html/404.html.heex index 134e68ba..69233a7a 100644 --- a/lib/towerops_web/controllers/error_html/404.html.heex +++ b/lib/towerops_web/controllers/error_html/404.html.heex @@ -3,7 +3,7 @@ - 404 - Page Not Found + {t("404 - Page Not Found")} @@ -19,17 +19,17 @@
Squirrel eating wires

- Oops, a squirrel must have eaten that wire! + {t("Oops, a squirrel must have eaten that wire!")}

- The page you're looking for could not be found. + {t("The page you're looking for could not be found.")}

@@ -37,7 +37,7 @@ href="/" class="inline-flex items-center justify-center rounded-full py-3 px-6 text-sm font-semibold bg-blue-600 text-white hover:bg-blue-500 active:bg-blue-800 transition-colors" > - Go back home + {t("Go back home")} diff --git a/lib/towerops_web/controllers/error_html/500.html.heex b/lib/towerops_web/controllers/error_html/500.html.heex index 563bfd78..cf059885 100644 --- a/lib/towerops_web/controllers/error_html/500.html.heex +++ b/lib/towerops_web/controllers/error_html/500.html.heex @@ -3,7 +3,7 @@ - 500 - Server Error + {t("500 - Server Error")} @@ -17,10 +17,10 @@

- Something went wrong on our end + {t("Something went wrong on our end")}

- We're working on fixing the problem. Please try again later. + {t("We're working on fixing the problem. Please try again later.")}

@@ -28,7 +28,7 @@ href="/" class="inline-flex items-center justify-center rounded-full py-3 px-6 text-sm font-semibold bg-blue-600 text-white hover:bg-blue-500 active:bg-blue-800 transition-colors" > - Go back home + {t("Go back home")} diff --git a/lib/towerops_web/controllers/invitation_controller.ex b/lib/towerops_web/controllers/invitation_controller.ex index 1cc18772..087c9c4a 100644 --- a/lib/towerops_web/controllers/invitation_controller.ex +++ b/lib/towerops_web/controllers/invitation_controller.ex @@ -7,7 +7,7 @@ defmodule ToweropsWeb.InvitationController do case Organizations.get_invitation_by_token(token) do nil -> conn - |> put_flash(:error, "This invitation is invalid or has expired.") + |> put_flash(:error, t("This invitation is invalid or has expired.")) |> redirect(to: ~p"/") invitation -> @@ -29,12 +29,12 @@ defmodule ToweropsWeb.InvitationController do case Organizations.accept_invitation(invitation, user.id) do {:ok, _membership} -> conn - |> put_flash(:info, "You've joined #{invitation.organization.name}!") + |> put_flash(:info, t("You've joined %{org}!", org: invitation.organization.name)) |> redirect(to: ~p"/orgs/#{invitation.organization.slug}/settings?tab=members") {:error, _changeset} -> conn - |> put_flash(:error, "Could not accept invitation. You may already be a member.") + |> put_flash(:error, t("Could not accept invitation. You may already be a member.")) |> redirect(to: ~p"/dashboard") end end diff --git a/lib/towerops_web/controllers/user_confirmation_controller.ex b/lib/towerops_web/controllers/user_confirmation_controller.ex index afb622a9..a8749fcb 100644 --- a/lib/towerops_web/controllers/user_confirmation_controller.ex +++ b/lib/towerops_web/controllers/user_confirmation_controller.ex @@ -30,12 +30,12 @@ defmodule ToweropsWeb.UserConfirmationController do case Accounts.confirm_user(token) do {:ok, _user} -> conn - |> put_flash(:info, "Email confirmed successfully. You may now log in.") + |> put_flash(:info, t("Email confirmed successfully. You may now log in.")) |> redirect(to: ~p"/users/log-in") :error -> conn - |> put_flash(:error, "Email confirmation link is invalid or has expired.") + |> put_flash(:error, t("Email confirmation link is invalid or has expired.")) |> redirect(to: ~p"/users/log-in") end end diff --git a/lib/towerops_web/controllers/user_confirmation_html/new.html.heex b/lib/towerops_web/controllers/user_confirmation_html/new.html.heex index 1c917119..6e565a61 100644 --- a/lib/towerops_web/controllers/user_confirmation_html/new.html.heex +++ b/lib/towerops_web/controllers/user_confirmation_html/new.html.heex @@ -1,15 +1,15 @@
- <.header>Resend confirmation instructions + <.header>{t_auth("Resend confirmation instructions")} <.form for={%{}} as={:user} action={~p"/users/confirm"} class="mt-8"> - <.input name="user[email]" type="email" label="Email" required /> - <.button class="w-full mt-4">Resend confirmation instructions + <.input name="user[email]" type="email" label={t_auth("Email")} required /> + <.button class="w-full mt-4">{t_auth("Resend confirmation instructions")}

- <.link href={~p"/users/log-in"}>Log in - | <.link href={~p"/users/register"}>Register + <.link href={~p"/users/log-in"}>{t_auth("Log in")} + | <.link href={~p"/users/register"}>{t_auth("Register")}

diff --git a/lib/towerops_web/controllers/user_registration_controller.ex b/lib/towerops_web/controllers/user_registration_controller.ex index 837911af..a916e436 100644 --- a/lib/towerops_web/controllers/user_registration_controller.ex +++ b/lib/towerops_web/controllers/user_registration_controller.ex @@ -38,7 +38,7 @@ defmodule ToweropsWeb.UserRegistrationController do case Accounts.register_user_with_organization(user_params) do {:ok, user} -> conn - |> put_flash(:info, "Account created successfully.") + |> put_flash(:info, t("Account created successfully.")) |> UserAuth.log_in_user(user) {:error, %Ecto.Changeset{} = changeset} -> @@ -55,14 +55,14 @@ defmodule ToweropsWeb.UserRegistrationController do {:ok, user} <- Accounts.register_user(user_params), {:ok, _membership} <- Organizations.accept_invitation(invitation, user.id) do conn - |> put_flash(:info, "Account created successfully. Welcome to #{invitation.organization.name}!") + |> put_flash(:info, t("Account created successfully. Welcome to %{org}!", org: invitation.organization.name)) |> UserAuth.log_in_user(user) else {:error, :invalid_invitation} -> changeset = Accounts.change_user_registration(%User{}, user_params) conn - |> put_flash(:error, "Invalid or expired invitation link.") + |> put_flash(:error, t("Invalid or expired invitation link.")) |> render(:new, form: Phoenix.Component.to_form(changeset, as: "user"), invitation: nil, diff --git a/lib/towerops_web/controllers/user_reset_password_controller.ex b/lib/towerops_web/controllers/user_reset_password_controller.ex index 29f8dcb2..222a585a 100644 --- a/lib/towerops_web/controllers/user_reset_password_controller.ex +++ b/lib/towerops_web/controllers/user_reset_password_controller.ex @@ -33,7 +33,7 @@ defmodule ToweropsWeb.UserResetPasswordController do case Accounts.get_user_by_reset_password_token(token) do nil -> conn - |> put_flash(:error, "Reset password link is invalid or has expired.") + |> put_flash(:error, t("Reset password link is invalid or has expired.")) |> redirect(to: ~p"/users/log-in") _user -> @@ -46,14 +46,14 @@ defmodule ToweropsWeb.UserResetPasswordController do case Accounts.get_user_by_reset_password_token(token) do nil -> conn - |> put_flash(:error, "Reset password link is invalid or has expired.") + |> put_flash(:error, t("Reset password link is invalid or has expired.")) |> redirect(to: ~p"/users/log-in") user -> case Accounts.reset_user_password(user, user_params) do {:ok, {updated_user, _expired_tokens}} -> conn - |> put_flash(:info, "Password reset successfully.") + |> put_flash(:info, t("Password reset successfully.")) |> UserAuth.log_in_user(updated_user, %{"remember_me" => "true"}) {:error, changeset} -> diff --git a/lib/towerops_web/controllers/user_session_controller.ex b/lib/towerops_web/controllers/user_session_controller.ex index b2402f42..5885a23a 100644 --- a/lib/towerops_web/controllers/user_session_controller.ex +++ b/lib/towerops_web/controllers/user_session_controller.ex @@ -20,7 +20,7 @@ defmodule ToweropsWeb.UserSessionController do {:ok, {user, _expired_tokens}} -> conn = if params["_action"] == "confirmed" do - put_flash(conn, :info, "User confirmed successfully.") + put_flash(conn, :info, t("User confirmed successfully.")) else conn end @@ -29,7 +29,7 @@ defmodule ToweropsWeb.UserSessionController do {:error, :not_found} -> conn - |> put_flash(:error, "The link is invalid or it has expired.") + |> put_flash(:error, t("The link is invalid or it has expired.")) |> render(:new, form: Phoenix.Component.to_form(%{}, as: "user")) end end @@ -64,7 +64,7 @@ defmodule ToweropsWeb.UserSessionController do # In order to prevent user enumeration attacks, don't disclose whether the email is registered. conn - |> put_flash(:error, "Invalid email or password") + |> put_flash(:error, t("Invalid email or password")) |> render(:new, form: form) end end @@ -101,7 +101,7 @@ defmodule ToweropsWeb.UserSessionController do if was_confirmed do conn else - put_flash(conn, :info, "User confirmed successfully.") + put_flash(conn, :info, t("User confirmed successfully.")) end # Always use remember_me: true to keep user logged in @@ -109,14 +109,14 @@ defmodule ToweropsWeb.UserSessionController do {:error, :not_found} -> conn - |> put_flash(:error, "Magic link is invalid or it has expired.") + |> put_flash(:error, t("Magic link is invalid or it has expired.")) |> redirect(to: ~p"/users/log-in") end end def delete(conn, _params) do conn - |> put_flash(:info, "Logged out successfully.") + |> put_flash(:info, t("Logged out successfully.")) |> UserAuth.log_out_user() end @@ -124,7 +124,7 @@ defmodule ToweropsWeb.UserSessionController do case get_session(conn, :pending_totp_user_id) do nil -> conn - |> put_flash(:error, "Please log in first.") + |> put_flash(:error, t("Please log in first.")) |> redirect(to: ~p"/users/log-in") _user_id -> @@ -145,7 +145,7 @@ defmodule ToweropsWeb.UserSessionController do defp redirect_to_login(conn) do conn - |> put_flash(:error, "Please log in first.") + |> put_flash(:error, t("Please log in first.")) |> redirect(to: ~p"/users/log-in") end @@ -189,7 +189,7 @@ defmodule ToweropsWeb.UserSessionController do form = Phoenix.Component.to_form(%{"totp_code" => code}, as: "user") conn - |> put_flash(:error, "Invalid authentication code. Please try again.") + |> put_flash(:error, t("Invalid authentication code. Please try again.")) |> render(:totp, form: form) end end diff --git a/lib/towerops_web/controllers/user_session_html/confirm.html.heex b/lib/towerops_web/controllers/user_session_html/confirm.html.heex index 64e167d4..523480b9 100644 --- a/lib/towerops_web/controllers/user_session_html/confirm.html.heex +++ b/lib/towerops_web/controllers/user_session_html/confirm.html.heex @@ -1,7 +1,7 @@
- <.header>Welcome {@user.email} + <.header>{t_auth("Welcome %{email}", email: @user.email)}
@@ -17,14 +17,14 @@ <.button name={@form[:remember_me].name} value="true" - phx-disable-with="Confirming..." + phx-disable-with={t_auth("Confirming...")} class="w-full" variant="primary" > - Confirm and stay logged in + {t_auth("Confirm and stay logged in")} - <.button phx-disable-with="Confirming..." class="w-full"> - Confirm and log in only this time + <.button phx-disable-with={t_auth("Confirming...")} class="w-full"> + {t_auth("Confirm and log in only this time")}
@@ -38,22 +38,22 @@ > <%= if @current_scope do %> - <.button variant="primary" phx-disable-with="Logging in..." class="w-full"> - Log in + <.button variant="primary" phx-disable-with={t_auth("Logging in...")} class="w-full"> + {t_auth("Log in")} <% else %>
<.button name={@form[:remember_me].name} value="true" - phx-disable-with="Logging in..." + phx-disable-with={t_auth("Logging in...")} class="w-full" variant="primary" > - Log in and stay logged in + {t_auth("Log in and stay logged in")} - <.button phx-disable-with="Logging in..." class="w-full"> - Log in only this time + <.button phx-disable-with={t_auth("Logging in...")} class="w-full"> + {t_auth("Log in only this time")}
<% end %> @@ -64,7 +64,7 @@ :if={!@user.confirmed_at} class="mt-6 rounded-lg border border-blue-200 bg-blue-50 p-4 text-sm text-blue-700 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200" > - Tip: If you prefer passwords, you can enable them in the user settings. + {t_auth("Tip: If you prefer passwords, you can enable them in the user settings.")}

diff --git a/lib/towerops_web/controllers/user_session_html/new.html.heex b/lib/towerops_web/controllers/user_session_html/new.html.heex index 8d565222..41463891 100644 --- a/lib/towerops_web/controllers/user_session_html/new.html.heex +++ b/lib/towerops_web/controllers/user_session_html/new.html.heex @@ -111,7 +111,7 @@ href={~p"/users/confirm"} class="text-blue-600 hover:text-blue-700 dark:text-blue-400" > - Didn't receive confirmation instructions? + {t_auth("Didn't receive confirmation instructions?")}

diff --git a/lib/towerops_web/controllers/user_session_html/totp.html.heex b/lib/towerops_web/controllers/user_session_html/totp.html.heex index f8573962..2102984f 100644 --- a/lib/towerops_web/controllers/user_session_html/totp.html.heex +++ b/lib/towerops_web/controllers/user_session_html/totp.html.heex @@ -2,9 +2,9 @@
<.header> - Two-Factor Authentication + {t_auth("Two-Factor Authentication")} <:subtitle> - Enter the 6-digit code from your authenticator app + {t_auth("Enter the 6-digit code from your authenticator app")}
@@ -14,7 +14,7 @@ <.input field={f[:totp_code]} type="text" - label="Authentication Code" + label={t_auth("Authentication Code")} placeholder="000000" autocomplete="one-time-code" inputmode="numeric" @@ -23,12 +23,12 @@ />

- Enter the 6-digit code from your authenticator app, or use a recovery code (XXXX-XXXX format). + {t_auth("Enter the 6-digit code from your authenticator app, or use a recovery code (XXXX-XXXX format).")}

<.button class="w-full" variant="primary"> - Verify + {t_auth("Verify")}
@@ -38,7 +38,7 @@ href={~p"/users/log-in"} class="text-sm font-semibold text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300" > - ← Back to login + {t_auth("← Back to login")}
diff --git a/lib/towerops_web/controllers/user_settings_controller.ex b/lib/towerops_web/controllers/user_settings_controller.ex index 7b9b486e..d0d2ff91 100644 --- a/lib/towerops_web/controllers/user_settings_controller.ex +++ b/lib/towerops_web/controllers/user_settings_controller.ex @@ -13,12 +13,12 @@ defmodule ToweropsWeb.UserSettingsController do case Accounts.update_user_email(conn.assigns.current_scope.user, token) do {:ok, _user} -> conn - |> put_flash(:info, "Email changed successfully.") + |> put_flash(:info, t("Email changed successfully.")) |> redirect(to: ~p"/users/settings") {:error, _} -> conn - |> put_flash(:error, "Email change link is invalid or it has expired.") + |> put_flash(:error, t("Email change link is invalid or it has expired.")) |> redirect(to: ~p"/users/settings") end end diff --git a/lib/towerops_web/controllers/user_settings_html/edit.html.heex b/lib/towerops_web/controllers/user_settings_html/edit.html.heex index 95a85cc5..8011ad1e 100644 --- a/lib/towerops_web/controllers/user_settings_html/edit.html.heex +++ b/lib/towerops_web/controllers/user_settings_html/edit.html.heex @@ -1,17 +1,17 @@
<.header> - Account Settings - <:subtitle>Manage your account email address and password settings + {t_auth("Account Settings")} + <:subtitle>{t_auth("Manage your account email address and password settings")}
<.form :let={f} for={@email_changeset} action={~p"/users/settings"} id="update_email"> - <.input field={f[:email]} type="email" label="Email" autocomplete="email" required /> + <.input field={f[:email]} type="email" label={t_auth("Email")} autocomplete="email" required /> - <.button variant="primary" phx-disable-with="Changing...">Change Email + <.button variant="primary" phx-disable-with={t_auth("Changing...")}>{t_auth("Change Email")}
@@ -22,19 +22,19 @@ <.input field={f[:password]} type="password" - label="New password" + label={t_auth("New password")} autocomplete="new-password" required /> <.input field={f[:password_confirmation]} type="password" - label="Confirm new password" + label={t_auth("Confirm new password")} autocomplete="new-password" required /> - <.button variant="primary" phx-disable-with="Changing..."> - Save Password + <.button variant="primary" phx-disable-with={t_auth("Changing...")}> + {t_auth("Save Password")} @@ -42,10 +42,10 @@

- Alert Notification Devices + {t_auth("Alert Notification Devices")}

- Manage mobile devices that receive push notifications for alerts + {t_auth("Manage mobile devices that receive push notifications for alerts")}

@@ -53,10 +53,10 @@
<.icon name="hero-device-phone-mobile" class="mx-auto h-12 w-12 text-gray-400" />

- No mobile devices registered + {t_auth("No mobile devices registered")}

- Add a mobile device to receive push notifications for alerts + {t_auth("Add a mobile device to receive push notifications for alerts")}

<% else %> @@ -67,13 +67,13 @@ <.icon name="hero-device-phone-mobile" class="h-5 w-5 text-gray-400" />

- {session.device_name || "Unknown Device"} + {session.device_name || t_auth("Unknown Device")}

{session.device_os} • {session.app_version}

- Last used {ToweropsWeb.TimeHelpers.format_date(session.last_used_at, "UTC")} + {t_auth("Last used %{date}", date: ToweropsWeb.TimeHelpers.format_date(session.last_used_at, "UTC"))}

@@ -105,9 +105,9 @@ ]} > <%= if session.alerts_enabled do %> - <.icon name="hero-bell" class="h-4 w-4" /> Alerts On + <.icon name="hero-bell" class="h-4 w-4" /> {t_auth("Alerts On")} <% else %> - <.icon name="hero-bell-slash" class="h-4 w-4" /> Alerts Off + <.icon name="hero-bell-slash" class="h-4 w-4" /> {t_auth("Alerts Off")} <% end %> @@ -122,10 +122,10 @@
@@ -138,7 +138,7 @@ navigate={~p"/mobile/qr-login"} class="inline-flex items-center gap-2 rounded-lg bg-gray-900 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-700 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-300" > - <.icon name="hero-qr-code" class="h-4 w-4" /> Add Mobile Device + <.icon name="hero-qr-code" class="h-4 w-4" /> {t_auth("Add Mobile Device")}
diff --git a/lib/towerops_web/controllers/user_sudo_controller.ex b/lib/towerops_web/controllers/user_sudo_controller.ex index 21c112d5..e2f9f119 100644 --- a/lib/towerops_web/controllers/user_sudo_controller.ex +++ b/lib/towerops_web/controllers/user_sudo_controller.ex @@ -29,7 +29,7 @@ defmodule ToweropsWeb.UserSudoController do # No TOTP devices, must enroll first !Accounts.totp_enabled?(user) -> conn - |> put_flash(:error, "Two-factor authentication is required for this action.") + |> put_flash(:error, t("Two-factor authentication is required for this action.")) |> redirect(to: ~p"/account/totp-enrollment") # Show verification form @@ -61,7 +61,7 @@ defmodule ToweropsWeb.UserSudoController do return_to = get_session(conn, :user_return_to) || ~p"/users/settings" conn - |> put_flash(:info, "Identity verified.") + |> put_flash(:info, t("Identity verified.")) |> delete_session(:user_return_to) |> redirect(to: return_to) @@ -70,7 +70,7 @@ defmodule ToweropsWeb.UserSudoController do form = Phoenix.Component.to_form(%{"totp_code" => totp_code}, as: "user") conn - |> put_flash(:error, "Failed to grant sudo mode. Please try again.") + |> put_flash(:error, t("Failed to grant sudo mode. Please try again.")) |> render(:verify, form: form) end @@ -88,7 +88,7 @@ defmodule ToweropsWeb.UserSudoController do form = Phoenix.Component.to_form(%{"totp_code" => totp_code}, as: "user") conn - |> put_flash(:error, "Invalid authentication code. Please try again.") + |> put_flash(:error, t("Invalid authentication code. Please try again.")) |> render(:verify, form: form) end end diff --git a/lib/towerops_web/controllers/user_sudo_html/verify.html.heex b/lib/towerops_web/controllers/user_sudo_html/verify.html.heex index c94127b6..d79912c4 100644 --- a/lib/towerops_web/controllers/user_sudo_html/verify.html.heex +++ b/lib/towerops_web/controllers/user_sudo_html/verify.html.heex @@ -2,9 +2,9 @@
<.header> - Re-authenticate + {t_auth("Re-authenticate")} <:subtitle> - Enter the 6-digit code from your authenticator app to continue + {t_auth("Enter the 6-digit code from your authenticator app to continue")}
@@ -14,7 +14,7 @@ <.input field={f[:totp_code]} type="text" - label="Authentication Code" + label={t_auth("Authentication Code")} placeholder="000000" autocomplete="one-time-code" inputmode="numeric" @@ -23,12 +23,12 @@ />

- Enter the 6-digit code from your authenticator app. Recovery codes are not allowed for sensitive operations. + {t_auth("Enter the 6-digit code from your authenticator app. Recovery codes are not allowed for sensitive operations.")}

<.button class="w-full" variant="primary"> - Verify + {t_auth("Verify")}
@@ -39,7 +39,7 @@ method="delete" class="text-sm font-semibold text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300" > - ← Log out instead + {t_auth("← Log out instead")}
diff --git a/lib/towerops_web/live/account_live/activity.ex b/lib/towerops_web/live/account_live/activity.ex index 487b50a6..b32c4c31 100644 --- a/lib/towerops_web/live/account_live/activity.ex +++ b/lib/towerops_web/live/account_live/activity.ex @@ -16,7 +16,7 @@ defmodule ToweropsWeb.AccountLive.Activity do {:ok, socket - |> assign(:page_title, "Activity Log") + |> assign(:page_title, t("Activity Log")) |> assign(:audit_logs, audit_logs)} end diff --git a/lib/towerops_web/live/account_live/my_data.ex b/lib/towerops_web/live/account_live/my_data.ex index c15a9874..584310cf 100644 --- a/lib/towerops_web/live/account_live/my_data.ex +++ b/lib/towerops_web/live/account_live/my_data.ex @@ -19,13 +19,13 @@ defmodule ToweropsWeb.AccountLive.MyData do socket = socket - |> put_flash(:info, "Consent revoked successfully.") + |> put_flash(:info, t("Consent revoked successfully.")) |> assign(:user_data, Map.put(socket.assigns.user_data, :consents, get_user_consents(user))) {:noreply, socket} {:error, _} -> - {:noreply, put_flash(socket, :error, "Failed to revoke consent.")} + {:noreply, put_flash(socket, :error, t("Failed to revoke consent."))} end end @@ -55,7 +55,7 @@ defmodule ToweropsWeb.AccountLive.MyData do socket |> assign(:current_scope, scope) |> assign(:user_data, user_data) - |> assign(:page_title, "My Data") + |> assign(:page_title, t("My Data")) |> assign(:is_owner, is_owner)} end diff --git a/lib/towerops_web/live/account_live/totp_enrollment.ex b/lib/towerops_web/live/account_live/totp_enrollment.ex index 805d83ae..2409458d 100644 --- a/lib/towerops_web/live/account_live/totp_enrollment.ex +++ b/lib/towerops_web/live/account_live/totp_enrollment.ex @@ -42,7 +42,7 @@ defmodule ToweropsWeb.AccountLive.TotpEnrollment do socket = socket - |> assign(:page_title, "Set Up Two-Factor Authentication") + |> assign(:page_title, t("Set Up Two-Factor Authentication")) |> assign(:secret_base32, secret_base32) |> assign(:qr_code, qr_code) |> assign(:code, "") @@ -57,7 +57,7 @@ defmodule ToweropsWeb.AccountLive.TotpEnrollment do # Real secret will be generated when socket connects socket = socket - |> assign(:page_title, "Set Up Two-Factor Authentication") + |> assign(:page_title, t("Set Up Two-Factor Authentication")) |> assign(:secret_base32, nil) |> assign(:qr_code, nil) |> assign(:code, "") @@ -94,7 +94,7 @@ defmodule ToweropsWeb.AccountLive.TotpEnrollment do handle_valid_code(socket, user, secret) else Logger.warning("TOTP enrollment verification failed", user_email: user.email) - {:noreply, assign(socket, :error, "Invalid code. Please try again.")} + {:noreply, assign(socket, :error, t("Invalid code. Please try again."))} end end @@ -105,7 +105,7 @@ defmodule ToweropsWeb.AccountLive.TotpEnrollment do {:noreply, socket - |> put_flash(:info, "Two-factor authentication enabled successfully!") + |> put_flash(:info, t("Two-factor authentication enabled successfully!")) |> redirect(to: redirect_path)} end @@ -124,7 +124,7 @@ defmodule ToweropsWeb.AccountLive.TotpEnrollment do |> assign(:show_recovery_codes, true)} {:error, _changeset} -> - {:noreply, assign(socket, :error, "Failed to enable two-factor authentication. Please try again.")} + {:noreply, assign(socket, :error, t("Failed to enable two-factor authentication. Please try again."))} end end diff --git a/lib/towerops_web/live/activity_feed_live.ex b/lib/towerops_web/live/activity_feed_live.ex index 1cbd5cce..746363b4 100644 --- a/lib/towerops_web/live/activity_feed_live.ex +++ b/lib/towerops_web/live/activity_feed_live.ex @@ -30,7 +30,7 @@ defmodule ToweropsWeb.ActivityFeedLive do {:ok, socket - |> assign(:page_title, "Activity Feed") + |> assign(:page_title, t("Activity Feed")) |> assign(:active_types, @all_types) |> assign(:limit, @default_limit) |> assign(:has_more, true) diff --git a/lib/towerops_web/live/activity_feed_live.html.heex b/lib/towerops_web/live/activity_feed_live.html.heex index f5396b65..8b41e9ad 100644 --- a/lib/towerops_web/live/activity_feed_live.html.heex +++ b/lib/towerops_web/live/activity_feed_live.html.heex @@ -10,10 +10,10 @@ - Activity Feed + {t("Activity Feed")} <:subtitle> - Real-time NOC operations log — config changes, alerts, events, and syncs + {t("Real-time NOC operations log — config changes, alerts, events, and syncs")} @@ -29,7 +29,7 @@ type="text" name="search" value={@search} - placeholder="Search by device name, IP, site, or keyword..." + placeholder={t("Search by device name, IP, site, or keyword...")} phx-debounce="300" class="input input-bordered w-full pl-10 pr-10 bg-white dark:bg-gray-800 dark:border-gray-700 dark:text-white dark:placeholder-gray-500" /> @@ -91,14 +91,14 @@ <%= if @search != "" do %> No results for "{@search}" <% else %> - No activity yet + {t("No activity yet")} <% end %>

<%= if @search != "" do %> - Try adjusting your search terms or clearing the filters. + {t("Try adjusting your search terms or clearing the filters.")} <% else %> - Your network operations log is empty. Events will appear here in real time as config changes, alerts, device events, and syncs happen across your organization. + {t("Your network operations log is empty. Events will appear here in real time as config changes, alerts, device events, and syncs happen across your organization.")} <% end %>

@@ -126,7 +126,7 @@ - Live + {t("Live")}
diff --git a/lib/towerops_web/live/admin/agent_live/index.ex b/lib/towerops_web/live/admin/agent_live/index.ex index cd6dab57..669bea7b 100644 --- a/lib/towerops_web/live/admin/agent_live/index.ex +++ b/lib/towerops_web/live/admin/agent_live/index.ex @@ -20,7 +20,7 @@ defmodule ToweropsWeb.Admin.AgentLive.Index do {:ok, socket - |> assign(:page_title, "All Agents") + |> assign(:page_title, t("All Agents")) |> assign(:timezone, socket.assigns.current_scope.timezone) |> stream(:cloud_pollers, cloud_pollers) |> stream(:org_agents, org_agents) diff --git a/lib/towerops_web/live/admin/agent_live/index.html.heex b/lib/towerops_web/live/admin/agent_live/index.html.heex index 4bbb5185..8a853985 100644 --- a/lib/towerops_web/live/admin/agent_live/index.html.heex +++ b/lib/towerops_web/live/admin/agent_live/index.html.heex @@ -1,9 +1,9 @@
-

All Agents

+

{t("All Agents")}

- Agents across all organizations and cloud pollers + {t("Agents across all organizations and cloud pollers")}

@@ -18,7 +18,7 @@ rows={@streams.cloud_pollers} row_link={fn {_id, agent} -> ~p"/agents/#{agent.id}" end} > - <:col :let={{_id, agent}} label="Name"> + <:col :let={{_id, agent}} label={t("Name")}>
{agent.name} <%= if agent.allow_remote_debug do %> @@ -29,7 +29,7 @@
- <:col :let={{_id, agent}} label="Status"> + <:col :let={{_id, agent}} label={t("Status")}> <% {status, label} = agent_status(agent) %> @@ -37,7 +37,7 @@ - <:col :let={{_id, agent}} label="Devices"> + <:col :let={{_id, agent}} label={t("Devices")}> <% counts = Map.get(@device_counts, agent.id, %{direct: 0, total: 0}) %>
{counts.total} total @@ -50,7 +50,7 @@
- <:col :let={{_id, agent}} label="Last Seen"> + <:col :let={{_id, agent}} label={t("Last Seen")}>
<.timestamp datetime={agent.last_seen_at} timezone={@timezone} now={@now} />
@@ -65,7 +65,7 @@ <% end %> - <:col :let={{_id, agent}} label="Version"> + <:col :let={{_id, agent}} label={t("Version")}> <%= if agent.metadata["version"] do %>
{format_agent_version(agent.metadata["version"])} @@ -87,7 +87,7 @@ rows={@streams.org_agents} row_link={fn {_id, agent} -> ~p"/agents/#{agent.id}" end} > - <:col :let={{_id, agent}} label="Name"> + <:col :let={{_id, agent}} label={t("Name")}>
{agent.name} @@ -103,7 +103,7 @@
- <:col :let={{_id, agent}} label="Status"> + <:col :let={{_id, agent}} label={t("Status")}> <% {status, label} = agent_status(agent) %> @@ -111,7 +111,7 @@ - <:col :let={{_id, agent}} label="Devices"> + <:col :let={{_id, agent}} label={t("Devices")}> <% counts = Map.get(@device_counts, agent.id, %{direct: 0, total: 0}) %>
{counts.total} total @@ -124,7 +124,7 @@
- <:col :let={{_id, agent}} label="Last Seen"> + <:col :let={{_id, agent}} label={t("Last Seen")}>
<.timestamp datetime={agent.last_seen_at} timezone={@timezone} now={@now} />
@@ -139,7 +139,7 @@ <% end %> - <:col :let={{_id, agent}} label="Version"> + <:col :let={{_id, agent}} label={t("Version")}> <%= if agent.metadata["version"] do %>
{format_agent_version(agent.metadata["version"])} diff --git a/lib/towerops_web/live/admin/audit_live/index.ex b/lib/towerops_web/live/admin/audit_live/index.ex index d540911e..b8ad17d2 100644 --- a/lib/towerops_web/live/admin/audit_live/index.ex +++ b/lib/towerops_web/live/admin/audit_live/index.ex @@ -13,7 +13,7 @@ defmodule ToweropsWeb.Admin.AuditLive.Index do def mount(_params, _session, socket) do {:ok, socket - |> assign(:page_title, "Audit Logs") + |> assign(:page_title, t("Audit Logs")) |> assign(:search_email, "") |> assign(:search_action, "") |> assign(:date_from, "") diff --git a/lib/towerops_web/live/admin/dashboard_live.ex b/lib/towerops_web/live/admin/dashboard_live.ex index 05a7d0db..0bb81159 100644 --- a/lib/towerops_web/live/admin/dashboard_live.ex +++ b/lib/towerops_web/live/admin/dashboard_live.ex @@ -10,7 +10,7 @@ defmodule ToweropsWeb.Admin.DashboardLive do def mount(_params, _session, socket) do {:ok, socket - |> assign(:page_title, "Admin Dashboard") + |> assign(:page_title, t("Admin Dashboard")) |> assign(:timezone, socket.assigns.current_scope.timezone)} end diff --git a/lib/towerops_web/live/admin/dashboard_live.html.heex b/lib/towerops_web/live/admin/dashboard_live.html.heex index 789c7b4e..be6ec38d 100644 --- a/lib/towerops_web/live/admin/dashboard_live.html.heex +++ b/lib/towerops_web/live/admin/dashboard_live.html.heex @@ -1,13 +1,13 @@
-

Admin Dashboard

+

{t("Admin Dashboard")}

System overview and recent activity

-

Users

+

{t("Users")}

{@user_count}

<.link navigate={~p"/admin/users"} @@ -18,7 +18,7 @@
-

Organizations

+

{t("Organizations")}

{@org_count}

<.link navigate={~p"/admin/organizations"} @@ -33,7 +33,7 @@ <.icon name="hero-queue-list" class="w-5 h-5 inline mr-1" /> Oban Dashboard

- Monitor background jobs and queues + {t("Monitor background jobs and queues")}

<.link navigate={~p"/admin/oban"} @@ -48,7 +48,7 @@ <.icon name="hero-chart-bar" class="w-5 h-5 inline mr-1" /> LiveDashboard

- System metrics and performance + {t("System metrics and performance")}

<.link navigate={~p"/admin/dashboard"} @@ -63,7 +63,7 @@ <.icon name="hero-cpu-chip" class="w-5 h-5 inline mr-1" /> Job Monitoring

- Real-time polling and discovery job monitoring + {t("Real-time polling and discovery job monitoring")}

<.link navigate={~p"/admin/monitoring"} @@ -78,7 +78,7 @@ <.icon name="hero-server" class="w-5 h-5 inline mr-1" /> All Agents

- Agents across all organizations and cloud pollers + {t("Agents across all organizations and cloud pollers")}

<.link navigate={~p"/admin/agents"} @@ -91,7 +91,7 @@
-

Recent Audit Logs

+

{t("Recent Audit Logs")}

<.link navigate={~p"/admin/audit"} class="text-sm text-blue-600 dark:text-blue-400 hover:underline" @@ -100,10 +100,10 @@
<.table id="audit-logs" rows={@recent_logs}> - <:col :let={log} label="Action">{log.action} - <:col :let={log} label="User">{log.superuser && log.superuser.email} - <:col :let={log} label="Target">{log.target_user && log.target_user.email} - <:col :let={log} label="Time"> + <:col :let={log} label={t("Action")}>{log.action} + <:col :let={log} label={t("User")}>{log.superuser && log.superuser.email} + <:col :let={log} label={t("Target")}>{log.target_user && log.target_user.email} + <:col :let={log} label={t("Time")}> {ToweropsWeb.TimeHelpers.format_iso8601(log.inserted_at, @timezone)} diff --git a/lib/towerops_web/live/admin/monitoring_live.ex b/lib/towerops_web/live/admin/monitoring_live.ex index 1bf7fb3d..c868b82e 100644 --- a/lib/towerops_web/live/admin/monitoring_live.ex +++ b/lib/towerops_web/live/admin/monitoring_live.ex @@ -24,7 +24,7 @@ defmodule ToweropsWeb.Admin.MonitoringLive do socket = socket - |> assign(:page_title, "Job Monitoring") + |> assign(:page_title, t("Job Monitoring")) |> assign(:active_jobs, []) |> assign(:executing_jobs, []) |> assign(:stuck_jobs, []) diff --git a/lib/towerops_web/live/admin/monitoring_live.html.heex b/lib/towerops_web/live/admin/monitoring_live.html.heex index 733a283e..dcc69770 100644 --- a/lib/towerops_web/live/admin/monitoring_live.html.heex +++ b/lib/towerops_web/live/admin/monitoring_live.html.heex @@ -2,10 +2,10 @@

- Job Monitoring Dashboard + {t("Job Monitoring Dashboard")}

- Real-time monitoring of polling and discovery jobs + {t("Real-time monitoring of polling and discovery jobs")}

@@ -28,19 +28,19 @@
-

Avg Duration

+

{t("Avg Duration")}

<%= if Map.get(@health_metrics, :avg_execution_time_seconds) do %> {Map.get(@health_metrics, :avg_execution_time_seconds) |> Float.round(1)}s <% else %> - N/A + {t("N/A")} <% end %>

last hour

-

Active Jobs

+

{t("Active Jobs")}

{length(@active_jobs)}

@@ -162,13 +162,13 @@

- Health Metrics + {t("Health Metrics")}

- Current Activity + {t("Current Activity")}

@@ -201,7 +201,7 @@

- Success Rates + {t("Success Rates")}

@@ -241,7 +241,7 @@

- Performance + {t("Performance")}

@@ -250,7 +250,7 @@ <%= if @metrics.avg_execution_time_seconds do %> {Float.round(@metrics.avg_execution_time_seconds, 1)}s <% else %> - N/A + {t("N/A")} <% end %>
@@ -266,7 +266,7 @@

- Queue Depths + {t("Queue Depths")}

@@ -286,7 +286,7 @@

- Updates every 10 seconds + {t("Updates every 10 seconds")}

@@ -294,7 +294,7 @@

- Recent Activity + {t("Recent Activity")}

<%= if length(@recent_events) == 0 do %> diff --git a/lib/towerops_web/live/admin/org_live/index.ex b/lib/towerops_web/live/admin/org_live/index.ex index 9467444c..6d4326f7 100644 --- a/lib/towerops_web/live/admin/org_live/index.ex +++ b/lib/towerops_web/live/admin/org_live/index.ex @@ -12,7 +12,7 @@ defmodule ToweropsWeb.Admin.OrgLive.Index do {:ok, socket - |> assign(:page_title, "All Organizations") + |> assign(:page_title, t("All Organizations")) |> assign(:timezone, socket.assigns.current_scope.timezone) |> assign(:organizations, orgs)} end diff --git a/lib/towerops_web/live/admin/org_live/index.html.heex b/lib/towerops_web/live/admin/org_live/index.html.heex index 6768c6ea..e218f701 100644 --- a/lib/towerops_web/live/admin/org_live/index.html.heex +++ b/lib/towerops_web/live/admin/org_live/index.html.heex @@ -1,26 +1,26 @@
-

All Organizations

+

{t("All Organizations")}

Manage organizations

<.table id="organizations" rows={@organizations}> - <:col :let={org} label="Name">{org.name} - <:col :let={org} label="Slug">{org.slug} - <:col :let={org} label="Members">{length(org.memberships)} - <:col :let={org} label="Created"> + <:col :let={org} label={t("Name")}>{org.name} + <:col :let={org} label={t("Slug")}>{org.slug} + <:col :let={org} label={t("Members")}>{length(org.memberships)} + <:col :let={org} label={t("Created")}> {ToweropsWeb.TimeHelpers.format_date(org.inserted_at, @timezone)} <:col :let={org} label=""> diff --git a/lib/towerops_web/live/admin/security_live/index.ex b/lib/towerops_web/live/admin/security_live/index.ex index 9b1e383c..c6bcae4c 100644 --- a/lib/towerops_web/live/admin/security_live/index.ex +++ b/lib/towerops_web/live/admin/security_live/index.ex @@ -19,7 +19,7 @@ defmodule ToweropsWeb.Admin.SecurityLive.Index do {:ok, socket - |> assign(:page_title, "Security - IP Access Control") + |> assign(:page_title, t("Security - IP Access Control")) |> assign(:current_tab, "whitelist")} end @@ -64,7 +64,7 @@ defmodule ToweropsWeb.Admin.SecurityLive.Index do {:ok, _entry} -> {:noreply, socket - |> put_flash(:info, "IP/CIDR added to allowlist") + |> put_flash(:info, t("IP/CIDR added to allowlist")) |> assign(:show_whitelist_form, false) |> load_data()} @@ -72,7 +72,7 @@ defmodule ToweropsWeb.Admin.SecurityLive.Index do {:noreply, socket |> assign(:whitelist_form, to_form(Map.put(changeset, :action, :validate))) - |> put_flash(:error, "Failed to add to allowlist")} + |> put_flash(:error, t("Failed to add to allowlist"))} end end @@ -81,11 +81,11 @@ defmodule ToweropsWeb.Admin.SecurityLive.Index do :ok -> {:noreply, socket - |> put_flash(:info, "Removed from allowlist") + |> put_flash(:info, t("Removed from allowlist")) |> load_data()} {:error, _} -> - {:noreply, put_flash(socket, :error, "Failed to remove from allowlist")} + {:noreply, put_flash(socket, :error, t("Failed to remove from allowlist"))} end end @@ -94,11 +94,11 @@ defmodule ToweropsWeb.Admin.SecurityLive.Index do {:ok, _} -> {:noreply, socket - |> put_flash(:info, "IP #{ip_address} unblocked") + |> put_flash(:info, t("IP %{ip_address} unblocked", ip_address: ip_address)) |> load_data()} {:error, _} -> - {:noreply, put_flash(socket, :error, "Failed to unblock IP")} + {:noreply, put_flash(socket, :error, t("Failed to unblock IP"))} end end diff --git a/lib/towerops_web/live/admin/security_live/index.html.heex b/lib/towerops_web/live/admin/security_live/index.html.heex index f1499498..a74d2635 100644 --- a/lib/towerops_web/live/admin/security_live/index.html.heex +++ b/lib/towerops_web/live/admin/security_live/index.html.heex @@ -1,9 +1,9 @@
-

IP Access Control

+

{t("IP Access Control")}

- Manage IP allowlist and view denied IPs + {t("Manage IP allowlist and view denied IPs")}

@@ -22,7 +22,7 @@ ) ]} > - Allowlist + {t("Allowlist")}
@@ -47,7 +47,7 @@

- Allowed IPs and CIDR Ranges + {t("Allowed IPs and CIDR Ranges")}

<.button phx-click="show_whitelist_form"> <.icon name="hero-plus" class="w-4 h-4 mr-1" /> Add to Allowlist @@ -65,7 +65,7 @@ <.input field={@whitelist_form[:ip_or_cidr]} type="text" - label="IP Address or CIDR" + label={t("IP Address or CIDR")} placeholder="192.168.1.100 or 10.0.0.0/8" required /> @@ -73,15 +73,15 @@ <.input field={@whitelist_form[:description]} type="text" - label="Description" - placeholder="Office network" + label={t("Description")} + placeholder={t("Office network")} />
- <.button type="submit">Add to Allowlist + <.button type="submit">{t("Add to Allowlist")} <.button type="button" phx-click="hide_whitelist_form"> - Cancel + {t("Cancel")}
@@ -91,30 +91,30 @@
<%= if Enum.empty?(@whitelist) do %>
- No allowed IPs or CIDR ranges + {t("No allowed IPs or CIDR ranges")}
<% else %> <.table id="whitelist" rows={@whitelist}> - <:col :let={entry} label="IP/CIDR">{entry.ip_or_cidr} - <:col :let={entry} label="Description">{entry.description} - <:col :let={entry} label="Added By"> + <:col :let={entry} label={t("IP/CIDR")}>{entry.ip_or_cidr} + <:col :let={entry} label={t("Description")}>{entry.description} + <:col :let={entry} label={t("Added By")}> <%= if entry.added_by do %> {entry.added_by.email} <% else %> Unknown <% end %> - <:col :let={entry} label="Added"> + <:col :let={entry} label={t("Added")}> {ToweropsWeb.TimeHelpers.format_date(entry.inserted_at, @timezone)} <:col :let={entry} label=""> @@ -127,7 +127,7 @@

- Denied IP Addresses + {t("Denied IP Addresses")}

@@ -147,12 +147,12 @@
<%= if Enum.empty?(@blocked_ips) do %>
- No denied IPs + {t("No denied IPs")}
<% else %> <.table id="blocked_ips" rows={@blocked_ips}> - <:col :let={block} label="IP Address">{block.ip_address} - <:col :let={block} label="Offense Count"> + <:col :let={block} label={t("IP Address")}>{block.ip_address} + <:col :let={block} label={t("Offense Count")}> - <:col :let={block} label="Status"> + <:col :let={block} label={t("Status")}> <%= if Towerops.Security.IpBlock.permanent?(block) do %> - Permanent + {t("Permanent")} <% else %> @@ -180,10 +180,10 @@ <% end %> - <:col :let={block} label="Last Violation"> + <:col :let={block} label={t("Last Violation")}> {ToweropsWeb.TimeHelpers.format_time_ago(block.last_violation_at)} - <:col :let={block} label="Reason"> + <:col :let={block} label={t("Reason")}>
{block.reason}
@@ -192,10 +192,10 @@ diff --git a/lib/towerops_web/live/admin/user_live/index.ex b/lib/towerops_web/live/admin/user_live/index.ex index 1afd41a1..15ba18f5 100644 --- a/lib/towerops_web/live/admin/user_live/index.ex +++ b/lib/towerops_web/live/admin/user_live/index.ex @@ -30,7 +30,7 @@ defmodule ToweropsWeb.Admin.UserLive.Index do {:ok, socket - |> assign(:page_title, "All Users") + |> assign(:page_title, t("All Users")) |> assign(:timezone, socket.assigns.current_scope.timezone) |> assign(:users, users) |> assign(:client_ip, ip)} diff --git a/lib/towerops_web/live/admin/user_live/index.html.heex b/lib/towerops_web/live/admin/user_live/index.html.heex index 0235d1f4..fa40bf4c 100644 --- a/lib/towerops_web/live/admin/user_live/index.html.heex +++ b/lib/towerops_web/live/admin/user_live/index.html.heex @@ -1,17 +1,17 @@
-

All Users

+

{t("All Users")}

Manage system users

<.table id="users" rows={@users}> - <:col :let={user} label="Email">{user.email} - <:col :let={user} label="Superuser">{if user.is_superuser, do: "Yes", else: "No"} - <:col :let={user} label="Organizations">{length(user.organizations)} - <:col :let={user} label="Devices">{user.device_count || 0} - <:col :let={user} label="Joined"> + <:col :let={user} label={t("Email")}>{user.email} + <:col :let={user} label={t("Superuser")}>{if user.is_superuser, do: "Yes", else: "No"} + <:col :let={user} label={t("Organizations")}>{length(user.organizations)} + <:col :let={user} label={t("Devices")}>{user.device_count || 0} + <:col :let={user} label={t("Joined")}> {ToweropsWeb.TimeHelpers.format_date(user.inserted_at, @timezone)} <:col :let={user} label=""> @@ -23,17 +23,17 @@ disabled={user.id == @current_scope.user.id} class="text-sm text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 disabled:text-gray-400 disabled:cursor-not-allowed" > - Impersonate + {t("Impersonate")}
diff --git a/lib/towerops_web/live/agent_live/edit.html.heex b/lib/towerops_web/live/agent_live/edit.html.heex index eecb899b..c14bf364 100644 --- a/lib/towerops_web/live/agent_live/edit.html.heex +++ b/lib/towerops_web/live/agent_live/edit.html.heex @@ -12,10 +12,10 @@

- Edit Agent + {t("Edit Agent")}

- Update the agent name. The authentication token cannot be changed. + {t("Update the agent name. The authentication token cannot be changed.")}

@@ -31,12 +31,12 @@ <.input field={@form[:name]} type="text" - label="Agent Name" + label={t("Agent Name")} placeholder="e.g., Datacenter Agent" required />

- A descriptive name to identify this agent in your organization. + {t("A descriptive name to identify this agent in your organization.")}

@@ -44,7 +44,7 @@ <.input field={@form[:allow_remote_debug]} type="checkbox" - label="Allow Remote Debugging" + label={t("Allow Remote Debugging")} />

Performance Impact

- When enabled, the server logs all SNMP data and messages for this agent. - This generates significant log volume and should only be enabled temporarily + {t("When enabled, the server logs all SNMP data and messages for this agent.")} + {t("This generates significant log volume and should only be enabled temporarily")} for troubleshooting.

@@ -65,8 +65,8 @@

- Enable verbose logging for troubleshooting SNMP discovery and polling issues. - Only organization members can toggle this setting. + {t("Enable verbose logging for troubleshooting SNMP discovery and polling issues.")} + {t("Only organization members can toggle this setting.")}

@@ -76,10 +76,10 @@ navigate={~p"/agents/#{@agent_token.id}"} class="text-sm font-semibold text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white" > - Cancel + {t("Cancel")} - <.button type="submit" phx-disable-with="Saving..."> - Save Changes + <.button type="submit" phx-disable-with={t("Saving...")}> + {t("Save Changes")}
diff --git a/lib/towerops_web/live/agent_live/index.ex b/lib/towerops_web/live/agent_live/index.ex index 13fad6e7..c5bb4b3a 100644 --- a/lib/towerops_web/live/agent_live/index.ex +++ b/lib/towerops_web/live/agent_live/index.ex @@ -53,7 +53,7 @@ defmodule ToweropsWeb.AgentLive.Index do {:ok, socket - |> assign(:page_title, "Remote Agents") + |> assign(:page_title, t("Remote Agents")) |> assign(:timezone, socket.assigns.current_scope.timezone) |> assign(:is_superuser, is_superuser) |> stream(:agent_tokens, agent_tokens) diff --git a/lib/towerops_web/live/agent_live/index.html.heex b/lib/towerops_web/live/agent_live/index.html.heex index bc7dab1a..bc8347dd 100644 --- a/lib/towerops_web/live/agent_live/index.html.heex +++ b/lib/towerops_web/live/agent_live/index.html.heex @@ -5,7 +5,7 @@ > <.header> {@page_title} - <:subtitle>Manage remote agents for local SNMP polling + <:subtitle>{t("Manage remote agents for local SNMP polling")} <:actions> <.button phx-click={JS.show(to: "#new-agent-form")} variant="primary"> <.icon name="hero-plus" class="h-5 w-5" /> New Agent @@ -17,14 +17,14 @@