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:
@@ -1,7 +1,8 @@
|
||||
{# app/templates/platform/base.html #}
|
||||
{# Base template for platform public pages (homepage, about, faq, etc.) #}
|
||||
{% from 'shared/macros/language_selector.html' import language_selector_compact %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" x-data="platformLayoutData()" x-bind:class="{ 'dark': dark }">
|
||||
<html lang="{{ current_language|default('en') }}" x-data="platformLayoutData()" x-bind:class="{ 'dark': dark }">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -70,13 +71,13 @@
|
||||
<div class="hidden md:flex items-center space-x-8">
|
||||
{# Main Navigation #}
|
||||
<a href="/pricing" class="text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400 font-medium transition-colors">
|
||||
Pricing
|
||||
{{ _("platform.nav.pricing") }}
|
||||
</a>
|
||||
<a href="/find-shop" class="text-gray-700 dark:text-gray-300 hover:text-indigo-600 dark:hover:text-indigo-400 font-medium transition-colors">
|
||||
Find Your Shop
|
||||
{{ _("platform.nav.find_shop") }}
|
||||
</a>
|
||||
<a href="/signup" class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white font-medium rounded-lg transition-colors">
|
||||
Start Free Trial
|
||||
{{ _("platform.nav.start_trial") }}
|
||||
</a>
|
||||
|
||||
{# Dynamic header navigation from CMS #}
|
||||
@@ -89,11 +90,17 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{# Language selector #}
|
||||
{{ language_selector_compact(
|
||||
current_language=current_language|default('en'),
|
||||
enabled_languages=SUPPORTED_LANGUAGES|default(['en', 'fr', 'de', 'lb'])
|
||||
) }}
|
||||
|
||||
{# Dark mode toggle #}
|
||||
<button
|
||||
@click="toggleDarkMode()"
|
||||
class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"
|
||||
aria-label="Toggle dark mode"
|
||||
aria-label="{{ _('platform.nav.toggle_dark_mode') }}"
|
||||
>
|
||||
<svg x-show="!dark" class="w-5 h-5 text-gray-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
|
||||
@@ -109,7 +116,7 @@
|
||||
<button
|
||||
@click="mobileMenuOpen = !mobileMenuOpen"
|
||||
class="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700"
|
||||
aria-label="Toggle menu"
|
||||
aria-label="{{ _('platform.nav.toggle_menu') }}"
|
||||
>
|
||||
<svg x-show="!mobileMenuOpen" class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
|
||||
@@ -156,13 +163,13 @@
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-sm">
|
||||
Lightweight OMS for Letzshop sellers. Manage orders, inventory, and invoicing.
|
||||
{{ _("platform.footer.tagline") }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{# Quick Links #}
|
||||
<div>
|
||||
<h4 class="font-semibold text-gray-900 dark:text-white mb-4">Quick Links</h4>
|
||||
<h4 class="font-semibold text-gray-900 dark:text-white mb-4">{{ _("platform.footer.quick_links") }}</h4>
|
||||
<ul class="space-y-2">
|
||||
{% if footer_pages %}
|
||||
{% for page in footer_pages %}
|
||||
@@ -179,16 +186,16 @@
|
||||
|
||||
{# Platform Links #}
|
||||
<div>
|
||||
<h4 class="font-semibold text-gray-900 dark:text-white mb-4">Platform</h4>
|
||||
<h4 class="font-semibold text-gray-900 dark:text-white mb-4">{{ _("platform.footer.platform") }}</h4>
|
||||
<ul class="space-y-2">
|
||||
<li>
|
||||
<a href="/admin/login" class="text-gray-600 dark:text-gray-400 hover:text-primary transition-colors">
|
||||
Admin Login
|
||||
{{ _("platform.nav.admin_login") }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/vendor/wizamart/login" class="text-gray-600 dark:text-gray-400 hover:text-primary transition-colors">
|
||||
Vendor Login
|
||||
{{ _("platform.nav.vendor_login") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -196,7 +203,7 @@
|
||||
|
||||
{# Contact Info #}
|
||||
<div>
|
||||
<h4 class="font-semibold text-gray-900 dark:text-white mb-4">Contact</h4>
|
||||
<h4 class="font-semibold text-gray-900 dark:text-white mb-4">{{ _("platform.footer.contact") }}</h4>
|
||||
<ul class="space-y-2 text-gray-600 dark:text-gray-400 text-sm">
|
||||
<li>support@marketplace.com</li>
|
||||
<li>+1 (555) 123-4567</li>
|
||||
@@ -210,14 +217,14 @@
|
||||
<div class="mt-12 pt-8 border-t border-gray-200 dark:border-gray-700">
|
||||
<div class="flex flex-col md:flex-row justify-between items-center">
|
||||
<p class="text-gray-600 dark:text-gray-400 text-sm">
|
||||
© 2025 Wizamart. Built for Luxembourg e-commerce.
|
||||
{{ _("platform.footer.copyright", year=2025) }}
|
||||
</p>
|
||||
<div class="flex space-x-6 mt-4 md:mt-0">
|
||||
<a href="/privacy" class="text-gray-600 dark:text-gray-400 hover:text-primary text-sm transition-colors">
|
||||
Privacy Policy
|
||||
{{ _("platform.footer.privacy") }}
|
||||
</a>
|
||||
<a href="/terms" class="text-gray-600 dark:text-gray-400 hover:text-primary text-sm transition-colors">
|
||||
Terms of Service
|
||||
{{ _("platform.footer.terms") }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user