feat(storefront): translatable Store description + nav home key + dynamic html lang

Three small storefront i18n improvements found during the FR
pre-launch walkthrough on FASHIONHUB:

- Store description (e.g. "Trendy clothing and accessories") was a
  single English string rendering in the footer regardless of locale.
  Added a description_translations JSON column on Store with the same
  shape used elsewhere (CMS, Platform, Subscription), exposed via
  get_translated_description(lang), and updated the footer + meta tag
  to use it. Seeded FR/DE/LB/EN for FASHIONHUB and FASHIONOUTLET so
  Fashion Group renders correctly out of the box. Other stores still
  show the single description field as fallback.

- "Home" was a hardcoded English literal in both desktop and mobile
  nav, even though the FR translation already existed at nav.home in
  static/locales/fr.json. Now uses _('nav.home').

- <html lang="en"> was hardcoded, which made <input type="date"> show
  in mm/dd/yyyy on the FR storefront. Now driven by current_language
  so the browser's locale-aware date picker matches the page locale.

Migration tenancy_005 adds the description_translations column;
nullable, no backfill needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-16 19:46:17 +02:00
parent caf1361291
commit 06a44e55e7
4 changed files with 64 additions and 5 deletions

View File

@@ -207,6 +207,12 @@ DEMO_STORES = [
"name": "Fashion Hub",
"subdomain": "fashionhub",
"description": "Trendy clothing and accessories",
"description_translations": {
"en": "Trendy clothing and accessories",
"fr": "Vêtements et accessoires tendance",
"de": "Trendige Kleidung und Accessoires",
"lb": "Trendeg Kleeder a Accessoiren",
},
"theme_preset": "vibrant",
"custom_domain": "fashionhub.store",
"custom_domain_platform": "loyalty", # Link domain to Loyalty platform
@@ -217,6 +223,12 @@ DEMO_STORES = [
"name": "Fashion Outlet",
"subdomain": "fashionoutlet",
"description": "Discounted designer fashion and seasonal clearance",
"description_translations": {
"en": "Discounted designer fashion and seasonal clearance",
"fr": "Mode de créateurs à prix réduit et soldes de saison",
"de": "Reduzierte Designermode und saisonale Restposten",
"lb": "Reduzéiert Designermode a Saisonsoldes",
},
"theme_preset": "vibrant",
"custom_domain": None,
},
@@ -932,6 +944,7 @@ def create_demo_stores(
name=store_data["name"],
subdomain=store_data["subdomain"],
description=store_data["description"],
description_translations=store_data.get("description_translations"),
is_active=True,
is_verified=True,
created_at=datetime.now(UTC),