feat(i18n): add multilingual platform descriptions and HostWizard demo data
Some checks failed
CI / ruff (push) Successful in 11s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled

- Add description_translations JSON column to Platform model + migration
- Add language tabs to platform admin edit form for multilingual descriptions
- Update API schemas to include description_translations in request/response
- Translate pricing section UI labels via _t() macro (monthly/annual/CTA/etc.)
- Add Luxembourgish (lb) support to all platforms (OMS, Main, Loyalty, Hosting)
- Seed description_translations, contact emails, and social links for all platforms
- Add LuxWeb Agency demo merchant with hosting stores, team, and content pages
- Fix language code typo: lu → lb in platform-edit.js availableLanguages
- Fix store content pages to use correct primary platform instead of hardcoded OMS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 23:38:52 +01:00
parent 2268f32f51
commit 820ab1aaa4
8 changed files with 327 additions and 32 deletions

View File

@@ -71,6 +71,13 @@ class Platform(Base, TimestampMixin):
comment="Platform description for admin/marketing purposes",
)
description_translations = Column(
JSON,
nullable=True,
default=None,
comment="Language-keyed description dict for multi-language support",
)
# ========================================================================
# Domain Routing
# ========================================================================
@@ -226,6 +233,17 @@ class Platform(Base, TimestampMixin):
# Properties
# ========================================================================
def get_translated_description(self, lang: str, default_lang: str = "fr") -> str:
"""Return description in the requested language with fallback."""
if self.description_translations:
return (
self.description_translations.get(lang)
or self.description_translations.get(default_lang)
or self.description
or ""
)
return self.description or ""
@property
def base_url(self) -> str:
"""Get the base URL for this platform (for link generation)."""