feat: add i18n translations to platform marketing website
- Add platform translation keys to all locale files (en, fr, de, lb) - Integrate language selector in platform base template header - Translate homepage-wizamart.html (hero, pricing, addons, find-shop, CTA) - Translate pricing.html, find-shop.html, signup-success.html - Add i18n context to platform routes via get_jinja2_globals() - Support variable interpolation for trial_days, count parameters 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.core.config import settings
|
||||
from app.core.database import get_db
|
||||
from app.utils.i18n import get_jinja2_globals
|
||||
|
||||
router = APIRouter()
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -28,7 +29,10 @@ templates = Jinja2Templates(directory=str(TEMPLATES_DIR))
|
||||
|
||||
def get_platform_context(request: Request, db: Session) -> dict:
|
||||
"""Build context for platform pages."""
|
||||
return {
|
||||
# Get language from request state (set by middleware)
|
||||
language = getattr(request.state, "language", "fr")
|
||||
|
||||
context = {
|
||||
"request": request,
|
||||
"platform_name": "Wizamart",
|
||||
"platform_domain": settings.platform_domain,
|
||||
@@ -36,6 +40,11 @@ def get_platform_context(request: Request, db: Session) -> dict:
|
||||
"trial_days": settings.stripe_trial_days,
|
||||
}
|
||||
|
||||
# Add i18n globals (_, t, current_language, SUPPORTED_LANGUAGES, etc.)
|
||||
context.update(get_jinja2_globals(language))
|
||||
|
||||
return context
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Homepage
|
||||
|
||||
Reference in New Issue
Block a user