feat(i18n): add multilingual platform descriptions and HostWizard demo data
Some checks failed
Some checks failed
- 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:
@@ -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)."""
|
||||
|
||||
Reference in New Issue
Block a user