fix(i18n): translate pricing tiers, features, and content pages
Some checks failed
Some checks failed
Add name_translations JSON column to SubscriptionTier for multi-language tier names. Pre-resolve tier names and build dynamic feature lists from module providers in route handlers. Fix Jinja2 macro scoping by importing pricing partial with context. Backfill content_translations for all 43 content pages across 4 platforms (en/fr/de/lb). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -55,6 +55,7 @@ for _mod in [
|
||||
"app.modules.orders.models",
|
||||
"app.modules.marketplace.models",
|
||||
"app.modules.cms.models",
|
||||
"app.modules.prospecting.models",
|
||||
"app.modules.hosting.models",
|
||||
]:
|
||||
with contextlib.suppress(ImportError):
|
||||
@@ -472,6 +473,10 @@ def create_subscription_tiers(db: Session, platform: Platform) -> int:
|
||||
{
|
||||
"code": "essential",
|
||||
"name": "Essential",
|
||||
"name_translations": {
|
||||
"en": "Essential", "fr": "Essentiel",
|
||||
"de": "Basis", "lb": "Basis",
|
||||
},
|
||||
"price_monthly_cents": 2900,
|
||||
"price_annual_cents": 29000,
|
||||
"is_public": True,
|
||||
@@ -480,6 +485,10 @@ def create_subscription_tiers(db: Session, platform: Platform) -> int:
|
||||
{
|
||||
"code": "professional",
|
||||
"name": "Professional",
|
||||
"name_translations": {
|
||||
"en": "Professional", "fr": "Professionnel",
|
||||
"de": "Professionell", "lb": "Professionell",
|
||||
},
|
||||
"price_monthly_cents": 7900,
|
||||
"price_annual_cents": 79000,
|
||||
"is_public": True,
|
||||
@@ -488,6 +497,10 @@ def create_subscription_tiers(db: Session, platform: Platform) -> int:
|
||||
{
|
||||
"code": "business",
|
||||
"name": "Business",
|
||||
"name_translations": {
|
||||
"en": "Business", "fr": "Business",
|
||||
"de": "Business", "lb": "Business",
|
||||
},
|
||||
"price_monthly_cents": 14900,
|
||||
"price_annual_cents": 149000,
|
||||
"is_public": True,
|
||||
@@ -496,6 +509,10 @@ def create_subscription_tiers(db: Session, platform: Platform) -> int:
|
||||
{
|
||||
"code": "enterprise",
|
||||
"name": "Enterprise",
|
||||
"name_translations": {
|
||||
"en": "Enterprise", "fr": "Entreprise",
|
||||
"de": "Enterprise", "lb": "Enterprise",
|
||||
},
|
||||
"price_monthly_cents": 29900,
|
||||
"price_annual_cents": None,
|
||||
"is_public": False,
|
||||
@@ -513,13 +530,19 @@ def create_subscription_tiers(db: Session, platform: Platform) -> int:
|
||||
).scalar_one_or_none()
|
||||
|
||||
if existing:
|
||||
print_warning(f"Tier already exists: {existing.name} ({existing.code}) for {platform.name}")
|
||||
# Backfill name_translations if missing
|
||||
if existing.name_translations is None and tdef.get("name_translations"):
|
||||
existing.name_translations = tdef["name_translations"]
|
||||
print_success(f"Backfilled name_translations: {existing.name} ({existing.code}) for {platform.name}")
|
||||
else:
|
||||
print_warning(f"Tier already exists: {existing.name} ({existing.code}) for {platform.name}")
|
||||
continue
|
||||
|
||||
tier = SubscriptionTier(
|
||||
platform_id=platform.id,
|
||||
code=tdef["code"],
|
||||
name=tdef["name"],
|
||||
name_translations=tdef.get("name_translations"),
|
||||
price_monthly_cents=tdef["price_monthly_cents"],
|
||||
price_annual_cents=tdef["price_annual_cents"],
|
||||
is_public=tdef["is_public"],
|
||||
|
||||
Reference in New Issue
Block a user