From 36aef7396951ff2b91677f877415b8bce4fd1fc3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Mar 2026 17:51:10 +0000 Subject: [PATCH] feat(i18n): localize admin plans page Add 108 admin_plans.* translation keys to en.json and update admin_plans.html to use _() for all static text and window.__i18nAdminPlans for dynamic Alpine.js / JavaScript strings. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- frontend/templates/admin_plans.html | 239 ++++++++++++++++------------ frontend/translations/en.json | 108 +++++++++++++ 2 files changed, 245 insertions(+), 102 deletions(-) diff --git a/frontend/templates/admin_plans.html b/frontend/templates/admin_plans.html index 41897e84..4cac2ed0 100644 --- a/frontend/templates/admin_plans.html +++ b/frontend/templates/admin_plans.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %}Plan Designer — DocuElevate Admin{% endblock %} +{% block title %}{{ _("admin_plans.page_title") }}{% endblock %} {% block content %}
-

Plan Designer

-

Manage subscription plans shown on the public pricing page.

+

{{ _("admin_plans.heading") }}

+

{{ _("admin_plans.subheading") }}

- Stripe Setup + {{ _("admin_plans.btn_stripe_setup") }}
-

About the Overage Buffer

+

{{ _("admin_plans.overage_buffer_title") }}

- The overage buffer is invisible to users. We advertise X docs/month but only enforce - at X × (1 + buffer%) docs. For example, a 150-doc/month plan with a 20% buffer - enforces at 180 docs. This prevents hard cutoffs at the exact announced limit, giving users a - graceful soft landing. + {{ _("admin_plans.overage_buffer_body_prefix") }} {{ _("admin_plans.overage_buffer_invisible") }}{{ _("admin_plans.overage_buffer_body_suffix") }} + {{ _("admin_plans.overage_buffer_formula") }} {{ _("admin_plans.overage_buffer_tail") }}

@@ -63,29 +61,29 @@
-

Loading plans…

+

{{ _("admin_plans.loading") }}

- +
- - - - - - - - + + + + + + + + @@ -97,13 +95,13 @@ @click="moveUp(idx)" :disabled="idx === 0" class="p-1 rounded hover:bg-gray-200 disabled:opacity-30" - :aria-label="'Move ' + plan.name + ' up'" + :aria-label="i18n.ariaMoveUp.replace('{name}', plan.name)" > @@ -115,13 +113,13 @@
@@ -171,8 +169,8 @@ class="inline-flex items-center px-4 py-2 rounded-md text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-indigo-500 disabled:opacity-50" > - Save Order - Saving… + {{ _("admin_plans.btn_save_order") }} + {{ _("admin_plans.btn_saving") }} @@ -195,8 +193,8 @@
- -
@@ -205,66 +203,66 @@
-

Basic Info

+

{{ _("admin_plans.section_basic_info") }}

- +
- + -

Lowercase slug, cannot be changed after creation.

+

{{ _("admin_plans.hint_plan_id") }}

- +
- +
- +
- +
-

Pricing

+

{{ _("admin_plans.section_pricing") }}

- +
- +

+ x-text="yearlySavingPct > 0 ? i18n.yearlySave.replace('{pct}', yearlySavingPct.toFixed(0)) : i18n.yearlyEnter">

- +
@@ -274,21 +272,21 @@
-

Stripe Integration

+

{{ _("admin_plans.section_stripe") }}

Stripe Wizard + aria-label="{{ _('admin_plans.stripe_wizard_aria') }}" + >{{ _("admin_plans.stripe_wizard_link") }}

- Enter the Stripe Price IDs for this plan, or use the - Stripe Setup Wizard - to auto-create them. Free plans do not need Stripe Price IDs. + {{ _("admin_plans.stripe_desc_before") }} + {{ _("admin_plans.stripe_wizard_text") }} + {{ _("admin_plans.stripe_desc_after") }}

-

Volume Limits

-

Enter 0 for unlimited.

+

{{ _("admin_plans.section_volume") }}

+

{{ _("admin_plans.hint_zero_unlimited") }}

- +
- +
- +
- +
- +
- +
@@ -345,15 +343,15 @@
-

Overage Designer

+

{{ _("admin_plans.section_overage") }}

@@ -368,27 +366,27 @@ aria-valuemax="100" />
- 0% (exact) - 50% - 100% + {{ _("admin_plans.overage_0pct") }} + {{ _("admin_plans.overage_50pct") }} + {{ _("admin_plans.overage_100pct") }}
- +
- Coming soon + {{ _("admin_plans.coming_soon") }}
- - {{ _("admin_plans.field_overage_doc_price") }} +
- - {{ _("admin_plans.field_overage_ocr_price") }} +
@@ -396,18 +394,18 @@
-

Features List

-

These bullet points appear on the pricing page card for this plan.

+

{{ _("admin_plans.section_features") }}

+

{{ _("admin_plans.hint_features") }}

-

Display

+

{{ _("admin_plans.section_display") }}

- +
- + @@ -438,7 +436,7 @@
- +
@@ -449,15 +447,15 @@ @click="modalOpen = false" class="px-4 py-2 text-sm font-medium border border-gray-300 rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-gray-400" > - Cancel + {{ _("admin_plans.btn_cancel") }}
@@ -467,9 +465,46 @@ + +
OrderPlanMonthlyYearlyMonthly LimitOverage %ActiveActions{{ _("admin_plans.col_order") }}{{ _("admin_plans.col_plan") }}{{ _("admin_plans.col_monthly") }}{{ _("admin_plans.col_yearly") }}{{ _("admin_plans.col_monthly_limit") }}{{ _("admin_plans.col_overage_pct") }}{{ _("admin_plans.col_active") }}{{ _("admin_plans.col_actions") }}
- + @@ -136,7 +134,7 @@ @@ -144,16 +142,16 @@