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:
@@ -6,7 +6,7 @@
|
||||
{% from 'cms/platform/sections/_hero.html' import render_hero %}
|
||||
{% from 'cms/platform/sections/_products.html' import render_products %}
|
||||
{% from 'cms/platform/sections/_features.html' import render_features %}
|
||||
{% from 'cms/platform/sections/_pricing.html' import render_pricing %}
|
||||
{% from 'cms/platform/sections/_pricing.html' import render_pricing with context %}
|
||||
{% from 'cms/platform/sections/_cta.html' import render_cta %}
|
||||
|
||||
{% block title %}
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
{# Pricing section partial with multi-language support #}
|
||||
{#
|
||||
Parameters:
|
||||
- pricing: PricingSection object (or dict)
|
||||
- pricing: PricingSection object (or dict) from CMS sections JSON
|
||||
- lang: Current language code
|
||||
- default_lang: Fallback language
|
||||
- tiers: List of subscription tiers from DB (passed via context)
|
||||
|
||||
Requires: import with context (for _() locale function)
|
||||
#}
|
||||
|
||||
{# Helper macro: resolve a TranslatableText field with fallback #}
|
||||
@@ -80,9 +82,6 @@
|
||||
<h3 class="text-xl font-bold text-gray-900 dark:text-white mb-2">
|
||||
{{ tier.name }}
|
||||
</h3>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-sm mb-4">
|
||||
{{ tier.description or '' }}
|
||||
</p>
|
||||
|
||||
{# Price #}
|
||||
<div class="mb-6">
|
||||
@@ -102,15 +101,23 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{# Features list #}
|
||||
{# Features list (dynamic from module providers) #}
|
||||
{% if tier.features %}
|
||||
<ul class="mt-8 space-y-3">
|
||||
{% for feature in tier.features %}
|
||||
{% for feat in tier.features %}
|
||||
<li class="flex items-start">
|
||||
<svg class="w-5 h-5 text-green-500 mr-3 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
||||
</svg>
|
||||
<span class="text-gray-600 dark:text-gray-400 text-sm">{{ feature }}</span>
|
||||
<span class="text-gray-600 dark:text-gray-400 text-sm">
|
||||
{% if feat.is_quantitative and feat.limit %}
|
||||
{{ feat.limit }} {{ _(feat.name_key) }}
|
||||
{% elif feat.is_quantitative %}
|
||||
{{ _(feat.name_key) }}
|
||||
{% else %}
|
||||
{{ _(feat.name_key) }}
|
||||
{% endif %}
|
||||
</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user