feat: migrate core components to gettext

Migrates consent prompt component strings to gettext for internationalization:
- Updated Policies modal title
- Policy review message
- Policy acceptance checkbox labels (Privacy Policy, Terms of Service)
- Consent disclaimer text
- Accept button text

All strings now use gettext() for translation support.
This commit is contained in:
Graham McIntire 2026-02-02 12:49:13 -06:00
parent a995e6283f
commit 2ef154e4d7
No known key found for this signature in database
2 changed files with 53 additions and 9 deletions

View file

@ -6,6 +6,7 @@ defmodule ToweropsWeb.Components.ConsentPrompt do
the updated privacy policy and/or terms of service.
"""
use Phoenix.Component
use Gettext, backend: ToweropsWeb.Gettext
import ToweropsWeb.CoreComponents
@ -40,11 +41,13 @@ defmodule ToweropsWeb.Components.ConsentPrompt do
class="text-lg font-semibold leading-6 text-gray-900 dark:text-white"
id="consent-modal-title"
>
Updated Policies - Action Required
{gettext("Updated Policies - Action Required")}
</h3>
<div class="mt-4 space-y-4">
<p class="text-sm text-gray-600 dark:text-gray-400">
We've updated our policies. Please review and accept the changes to continue using Towerops.
{gettext(
"We've updated our policies. Please review and accept the changes to continue using Towerops."
)}
</p>
<div class="space-y-3">
@ -66,7 +69,7 @@ defmodule ToweropsWeb.Components.ConsentPrompt do
for={"consent-#{policy_type}"}
class="text-gray-700 dark:text-gray-300"
>
I agree to the updated
{gettext("I agree to the updated")}
<.link
href={policy_link(policy_type)}
target="_blank"
@ -83,8 +86,9 @@ defmodule ToweropsWeb.Components.ConsentPrompt do
<div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-700">
<p class="text-xs text-gray-500 dark:text-gray-400">
By accepting, you acknowledge that you have read and agree to the updated policies.
You can review your consent history at any time from your account settings.
{gettext(
"By accepting, you acknowledge that you have read and agree to the updated policies. You can review your consent history at any time from your account settings."
)}
</p>
</div>
</div>
@ -98,7 +102,7 @@ defmodule ToweropsWeb.Components.ConsentPrompt do
class="inline-flex w-full justify-center rounded-md bg-blue-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-500 sm:ml-3 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed"
id="accept-policies-button"
>
Accept and Continue
{gettext("Accept and Continue")}
</button>
</div>
</div>
@ -108,9 +112,9 @@ defmodule ToweropsWeb.Components.ConsentPrompt do
"""
end
defp policy_name("privacy_policy"), do: "Privacy Policy"
defp policy_name("terms_of_service"), do: "Terms of Service"
defp policy_name(_), do: "Policy"
defp policy_name("privacy_policy"), do: gettext("Privacy Policy")
defp policy_name("terms_of_service"), do: gettext("Terms of Service")
defp policy_name(_), do: gettext("Policy")
defp policy_link("privacy_policy"), do: "/privacy"
defp policy_link("terms_of_service"), do: "/terms"

View file

@ -91,3 +91,43 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "or"
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:105
#, elixir-autogen, elixir-format
msgid "Accept and Continue"
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:89
#, elixir-autogen, elixir-format
msgid "By accepting, you acknowledge that you have read and agree to the updated policies. You can review your consent history at any time from your account settings."
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:72
#, elixir-autogen, elixir-format
msgid "I agree to the updated"
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:117
#, elixir-autogen, elixir-format
msgid "Policy"
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:115
#, elixir-autogen, elixir-format
msgid "Privacy Policy"
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:116
#, elixir-autogen, elixir-format
msgid "Terms of Service"
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:44
#, elixir-autogen, elixir-format
msgid "Updated Policies - Action Required"
msgstr ""
#: lib/towerops_web/components/consent_prompt.ex:48
#, elixir-autogen, elixir-format
msgid "We've updated our policies. Please review and accept the changes to continue using Towerops."
msgstr ""