refactor: complete JS i18n migration for confirm dialogs and toast messages
Migrate 34 hardcoded user-facing strings to use I18n.t() for translation: - CMS: media file operations (5 strings) - Marketplace: Letzshop integration (16 strings) - Messaging: notifications, messages, email templates (5 strings) - Tenancy: platform modules, menu config, theme (5 strings) - Core: menu config, settings, storefront cart (5 strings) - Catalog: product creation (3 strings) - Utils: clipboard operations (2 strings) Added confirmations and messages keys to module locale files. Added I18n.loadModule() calls to JS files that were missing them. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,126 +1,213 @@
|
||||
{
|
||||
"title": "Content Management",
|
||||
"description": "Manage content pages, media library, and vendor themes",
|
||||
"pages": {
|
||||
"title": "Content Pages",
|
||||
"subtitle": "Manage platform and vendor content pages",
|
||||
"create": "Create Page",
|
||||
"edit": "Edit Page",
|
||||
"delete": "Delete Page",
|
||||
"list": "All Pages",
|
||||
"empty": "No pages found",
|
||||
"empty_search": "No pages match your search",
|
||||
"create_first": "Create First Page"
|
||||
},
|
||||
"page": {
|
||||
"title": "Page Title",
|
||||
"slug": "Slug",
|
||||
"slug_help": "URL-safe identifier (lowercase, numbers, hyphens only)",
|
||||
"content": "Content",
|
||||
"content_format": "Content Format",
|
||||
"format_html": "HTML",
|
||||
"format_markdown": "Markdown",
|
||||
"platform": "Platform",
|
||||
"vendor_override": "Vendor Override",
|
||||
"vendor_override_none": "None (Platform Default)",
|
||||
"vendor_override_help_default": "This is a platform-wide default page",
|
||||
"vendor_override_help_vendor": "This page overrides the default for selected vendor only"
|
||||
},
|
||||
"tiers": {
|
||||
"platform": "Platform Marketing",
|
||||
"vendor_default": "Vendor Default",
|
||||
"vendor_override": "Vendor Override"
|
||||
},
|
||||
"seo": {
|
||||
"title": "SEO & Metadata",
|
||||
"meta_description": "Meta Description",
|
||||
"meta_description_help": "characters (150-160 recommended)",
|
||||
"meta_keywords": "Meta Keywords",
|
||||
"meta_keywords_placeholder": "keyword1, keyword2, keyword3"
|
||||
},
|
||||
"navigation": {
|
||||
"title": "Navigation & Display",
|
||||
"display_order": "Display Order",
|
||||
"display_order_help": "Lower = first",
|
||||
"show_in_header": "Show in Header",
|
||||
"show_in_footer": "Show in Footer",
|
||||
"show_in_legal": "Show in Legal",
|
||||
"show_in_legal_help": "Bottom bar next to copyright"
|
||||
},
|
||||
"publishing": {
|
||||
"published": "Published",
|
||||
"draft": "Draft",
|
||||
"publish_help": "Make this page visible to the public"
|
||||
},
|
||||
"homepage": {
|
||||
"title": "Homepage Sections",
|
||||
"subtitle": "Multi-language content",
|
||||
"loading": "Loading sections...",
|
||||
"hero": {
|
||||
"title": "Hero Section",
|
||||
"badge_text": "Badge Text",
|
||||
"main_title": "Title",
|
||||
"subtitle": "Subtitle",
|
||||
"buttons": "Buttons",
|
||||
"add_button": "Add Button"
|
||||
"platform": {
|
||||
"nav": {
|
||||
"pricing": "Pricing",
|
||||
"find_shop": "Find Your Shop",
|
||||
"start_trial": "Start Free Trial",
|
||||
"admin_login": "Admin Login",
|
||||
"vendor_login": "Vendor Login",
|
||||
"toggle_menu": "Toggle menu",
|
||||
"toggle_dark_mode": "Toggle dark mode"
|
||||
},
|
||||
"features": {
|
||||
"title": "Features Section",
|
||||
"section_title": "Section Title",
|
||||
"cards": "Feature Cards",
|
||||
"add_card": "Add Feature Card",
|
||||
"icon": "Icon name",
|
||||
"feature_title": "Title",
|
||||
"feature_description": "Description"
|
||||
"hero": {
|
||||
"badge": "{trial_days}-Day Free Trial - No Credit Card Required to Start",
|
||||
"title": "Lightweight OMS for Letzshop Sellers",
|
||||
"subtitle": "Order management, inventory, and invoicing built for Luxembourg e-commerce. Stop juggling spreadsheets. Start running your business.",
|
||||
"cta_trial": "Start Free Trial",
|
||||
"cta_find_shop": "Find Your Letzshop Shop"
|
||||
},
|
||||
"pricing": {
|
||||
"title": "Pricing Section",
|
||||
"section_title": "Section Title",
|
||||
"use_tiers": "Use subscription tiers from database",
|
||||
"use_tiers_help": "When enabled, pricing cards are dynamically pulled from your subscription tier configuration."
|
||||
"title": "Simple, Transparent Pricing",
|
||||
"subtitle": "Choose the plan that fits your business. All plans include a {trial_days}-day free trial.",
|
||||
"monthly": "Monthly",
|
||||
"annual": "Annual",
|
||||
"save_months": "Save 2 months!",
|
||||
"most_popular": "MOST POPULAR",
|
||||
"recommended": "RECOMMENDED",
|
||||
"contact_sales": "Contact Sales",
|
||||
"start_trial": "Start Free Trial",
|
||||
"per_month": "/month",
|
||||
"per_year": "/year",
|
||||
"custom": "Custom",
|
||||
"orders_per_month": "{count} orders/month",
|
||||
"unlimited_orders": "Unlimited orders",
|
||||
"products_limit": "{count} products",
|
||||
"unlimited_products": "Unlimited products",
|
||||
"team_members": "{count} team members",
|
||||
"unlimited_team": "Unlimited team",
|
||||
"letzshop_sync": "Letzshop order sync",
|
||||
"eu_vat_invoicing": "EU VAT invoicing",
|
||||
"analytics_dashboard": "Analytics dashboard",
|
||||
"api_access": "API access",
|
||||
"multi_channel": "Multi-channel integration",
|
||||
"products": "products",
|
||||
"team_member": "team member",
|
||||
"unlimited": "Unlimited",
|
||||
"order_history": "months order history",
|
||||
"trial_note": "All plans include a {trial_days}-day free trial. No credit card required.",
|
||||
"back_home": "Back to Home"
|
||||
},
|
||||
"features": {
|
||||
"letzshop_sync": "Letzshop order sync",
|
||||
"inventory_basic": "Basic inventory management",
|
||||
"inventory_locations": "Warehouse locations",
|
||||
"inventory_purchase_orders": "Purchase orders",
|
||||
"invoice_lu": "Luxembourg VAT invoicing",
|
||||
"invoice_eu_vat": "EU VAT invoicing",
|
||||
"invoice_bulk": "Bulk invoicing",
|
||||
"customer_view": "Customer list",
|
||||
"customer_export": "Customer export",
|
||||
"analytics_dashboard": "Analytics dashboard",
|
||||
"accounting_export": "Accounting export",
|
||||
"api_access": "API access",
|
||||
"automation_rules": "Automation rules",
|
||||
"team_roles": "Team roles & permissions",
|
||||
"white_label": "White-label option",
|
||||
"multi_vendor": "Multi-vendor support",
|
||||
"custom_integrations": "Custom integrations",
|
||||
"sla_guarantee": "SLA guarantee",
|
||||
"dedicated_support": "Dedicated account manager"
|
||||
},
|
||||
"addons": {
|
||||
"title": "Enhance Your Platform",
|
||||
"subtitle": "Add custom branding, professional email, and enhanced security.",
|
||||
"per_year": "/year",
|
||||
"per_month": "/month",
|
||||
"custom_domain": "Custom Domain",
|
||||
"custom_domain_desc": "Use your own domain (mydomain.com)",
|
||||
"premium_ssl": "Premium SSL",
|
||||
"premium_ssl_desc": "EV certificate for trust badges",
|
||||
"email_package": "Email Package",
|
||||
"email_package_desc": "Professional email addresses"
|
||||
},
|
||||
"find_shop": {
|
||||
"title": "Find Your Letzshop Shop",
|
||||
"subtitle": "Already selling on Letzshop? Enter your shop URL to get started.",
|
||||
"placeholder": "Enter your Letzshop URL (e.g., letzshop.lu/vendors/my-shop)",
|
||||
"button": "Find My Shop",
|
||||
"claim_shop": "Claim This Shop",
|
||||
"already_claimed": "Already Claimed",
|
||||
"no_account": "Don't have a Letzshop account?",
|
||||
"signup_letzshop": "Sign up with Letzshop first",
|
||||
"then_connect": ", then come back to connect your shop.",
|
||||
"search_placeholder": "Enter Letzshop URL or shop name...",
|
||||
"search_button": "Search",
|
||||
"examples": "Examples:",
|
||||
"claim_button": "Claim This Shop & Start Free Trial",
|
||||
"not_found": "We could not find a Letzshop shop with that URL. Please check and try again.",
|
||||
"or_signup": "Or sign up without a Letzshop connection",
|
||||
"need_help": "Need Help?",
|
||||
"no_account_yet": "Don't have a Letzshop account yet? No problem!",
|
||||
"create_letzshop": "Create a Letzshop Account",
|
||||
"signup_without": "Sign Up Without Letzshop",
|
||||
"looking_up": "Looking up your shop...",
|
||||
"found": "Found:",
|
||||
"claimed_badge": "Already Claimed"
|
||||
},
|
||||
"signup": {
|
||||
"step_plan": "Select Plan",
|
||||
"step_shop": "Claim Shop",
|
||||
"step_account": "Account",
|
||||
"step_payment": "Payment",
|
||||
"choose_plan": "Choose Your Plan",
|
||||
"save_percent": "Save {percent}%",
|
||||
"trial_info": "We'll collect your payment info, but you won't be charged until the trial ends.",
|
||||
"connect_shop": "Connect Your Letzshop Shop",
|
||||
"connect_optional": "Optional: Link your Letzshop account to sync orders automatically.",
|
||||
"connect_continue": "Connect & Continue",
|
||||
"skip_step": "Skip This Step",
|
||||
"create_account": "Create Your Account",
|
||||
"first_name": "First Name",
|
||||
"last_name": "Last Name",
|
||||
"company_name": "Company Name",
|
||||
"email": "Email",
|
||||
"password": "Password",
|
||||
"password_hint": "Minimum 8 characters",
|
||||
"continue": "Continue",
|
||||
"continue_payment": "Continue to Payment",
|
||||
"back": "Back",
|
||||
"add_payment": "Add Payment Method",
|
||||
"no_charge_note": "You won't be charged until your {trial_days}-day trial ends.",
|
||||
"processing": "Processing...",
|
||||
"start_trial": "Start Free Trial",
|
||||
"creating_account": "Creating your account..."
|
||||
},
|
||||
"success": {
|
||||
"title": "Welcome to Wizamart!",
|
||||
"subtitle": "Your account has been created and your {trial_days}-day free trial has started.",
|
||||
"what_next": "What's Next?",
|
||||
"step_connect": "Connect Letzshop:",
|
||||
"step_connect_desc": "Add your API key to start syncing orders automatically.",
|
||||
"step_invoicing": "Set Up Invoicing:",
|
||||
"step_invoicing_desc": "Configure your invoice settings for Luxembourg compliance.",
|
||||
"step_products": "Import Products:",
|
||||
"step_products_desc": "Sync your product catalog from Letzshop.",
|
||||
"go_to_dashboard": "Go to Dashboard",
|
||||
"login_dashboard": "Login to Dashboard",
|
||||
"need_help": "Need help getting started?",
|
||||
"contact_support": "Contact our support team"
|
||||
},
|
||||
"cta": {
|
||||
"title": "Call to Action Section",
|
||||
"main_title": "Title",
|
||||
"subtitle": "Subtitle",
|
||||
"buttons": "Buttons",
|
||||
"add_button": "Add Button"
|
||||
"title": "Ready to Streamline Your Orders?",
|
||||
"subtitle": "Join Letzshop vendors who trust Wizamart for their order management. Start your {trial_days}-day free trial today.",
|
||||
"button": "Start Free Trial"
|
||||
},
|
||||
"footer": {
|
||||
"tagline": "Lightweight OMS for Letzshop sellers. Manage orders, inventory, and invoicing.",
|
||||
"quick_links": "Quick Links",
|
||||
"platform": "Platform",
|
||||
"contact": "Contact",
|
||||
"copyright": "© {year} Wizamart. Built for Luxembourg e-commerce.",
|
||||
"privacy": "Privacy Policy",
|
||||
"terms": "Terms of Service",
|
||||
"about": "About Us",
|
||||
"faq": "FAQ",
|
||||
"contact_us": "Contact Us"
|
||||
},
|
||||
"modern": {
|
||||
"badge_integration": "Official Integration",
|
||||
"badge_connect": "Connect in 2 minutes",
|
||||
"hero_title_1": "Built for Luxembourg E-Commerce",
|
||||
"hero_title_2": "The Back-Office Letzshop Doesn't Give You",
|
||||
"hero_subtitle": "Sync orders, manage inventory, generate invoices with correct VAT, and own your customer data. All in one place.",
|
||||
"cta_trial": "Start {trial_days}-Day Free Trial",
|
||||
"cta_how": "See How It Works",
|
||||
"hero_note": "No credit card required. Setup in 5 minutes. Cancel anytime.",
|
||||
"pain_title": "Sound Familiar?",
|
||||
"pain_subtitle": "These are the daily frustrations of Letzshop sellers",
|
||||
"pain_manual": "Manual Order Entry",
|
||||
"pain_manual_desc": "Copy-pasting orders from Letzshop to spreadsheets. Every. Single. Day.",
|
||||
"pain_inventory": "Inventory Chaos",
|
||||
"pain_inventory_desc": "Stock in Letzshop doesn't match reality. Overselling happens.",
|
||||
"pain_vat": "Wrong VAT Invoices",
|
||||
"pain_vat_desc": "EU customers need correct VAT. Your accountant keeps complaining.",
|
||||
"pain_customers": "Lost Customers",
|
||||
"pain_customers_desc": "Letzshop owns your customer data. You can't retarget or build loyalty.",
|
||||
"how_title": "How It Works",
|
||||
"how_subtitle": "From Chaos to Control in 4 Steps",
|
||||
"how_step1": "Connect Letzshop",
|
||||
"how_step1_desc": "Enter your Letzshop API credentials. Done in 2 minutes, no technical skills needed.",
|
||||
"how_step2": "Orders Flow In",
|
||||
"how_step2_desc": "Orders sync automatically. Confirm and add tracking directly from Wizamart.",
|
||||
"how_step3": "Generate Invoices",
|
||||
"how_step3_desc": "One click to create compliant PDF invoices with correct VAT for any EU country.",
|
||||
"how_step4": "Grow Your Business",
|
||||
"how_step4_desc": "Export customers for marketing. Track inventory. Focus on selling, not spreadsheets.",
|
||||
"features_title": "Everything a Letzshop Seller Needs",
|
||||
"features_subtitle": "The operational tools Letzshop doesn't provide",
|
||||
"cta_final_title": "Ready to Take Control of Your Letzshop Business?",
|
||||
"cta_final_subtitle": "Join Luxembourg vendors who've stopped fighting spreadsheets and started growing their business.",
|
||||
"cta_final_note": "No credit card required. Setup in 5 minutes. Full Professional features during trial."
|
||||
}
|
||||
},
|
||||
"media": {
|
||||
"title": "Media Library",
|
||||
"upload": "Upload",
|
||||
"upload_file": "Upload File",
|
||||
"delete": "Delete",
|
||||
"empty": "No media files",
|
||||
"upload_first": "Upload your first file"
|
||||
},
|
||||
"themes": {
|
||||
"title": "Vendor Themes",
|
||||
"subtitle": "Manage vendor theme customizations"
|
||||
},
|
||||
"actions": {
|
||||
"save": "Save",
|
||||
"saving": "Saving...",
|
||||
"update": "Update Page",
|
||||
"create": "Create Page",
|
||||
"cancel": "Cancel",
|
||||
"back_to_list": "Back to List",
|
||||
"preview": "Preview",
|
||||
"revert_to_default": "Revert to Default"
|
||||
},
|
||||
"messages": {
|
||||
"created": "Page created successfully",
|
||||
"updated": "Page updated successfully",
|
||||
"deleted": "Page deleted successfully",
|
||||
"reverted": "Reverted to default page",
|
||||
"error_loading": "Error loading page",
|
||||
"error_saving": "Error saving page",
|
||||
"confirm_delete": "Are you sure you want to delete this page?"
|
||||
"failed_to_delete_page": "Failed to delete page: {error}",
|
||||
"media_updated_successfully": "Media updated successfully",
|
||||
"media_deleted_successfully": "Media deleted successfully",
|
||||
"url_copied_to_clipboard": "URL copied to clipboard",
|
||||
"failed_to_copy_url": "Failed to copy URL"
|
||||
},
|
||||
"filters": {
|
||||
"all_pages": "All Pages",
|
||||
"all_platforms": "All Platforms",
|
||||
"search_placeholder": "Search pages..."
|
||||
"confirmations": {
|
||||
"delete_file": "Are you sure you want to delete this file? This cannot be undone."
|
||||
}
|
||||
}
|
||||
|
||||
13
app/modules/cms/static/vendor/js/media.js
vendored
13
app/modules/cms/static/vendor/js/media.js
vendored
@@ -119,6 +119,9 @@ function vendorMedia() {
|
||||
uploadingFiles: [],
|
||||
|
||||
async init() {
|
||||
// Load i18n translations
|
||||
await I18n.loadModule('cms');
|
||||
|
||||
// Guard against duplicate initialization
|
||||
if (window._vendorMediaInitialized) return;
|
||||
window._vendorMediaInitialized = true;
|
||||
@@ -233,7 +236,7 @@ function vendorMedia() {
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
this.showToast('Media updated successfully', 'success');
|
||||
Utils.showToast(I18n.t('cms.messages.media_updated_successfully'), 'success');
|
||||
this.showDetailModal = false;
|
||||
await this.loadMedia();
|
||||
} else {
|
||||
@@ -250,7 +253,7 @@ function vendorMedia() {
|
||||
async deleteMedia() {
|
||||
if (!this.selectedMedia) return;
|
||||
|
||||
if (!confirm('Are you sure you want to delete this file? This cannot be undone.')) {
|
||||
if (!confirm(I18n.t('cms.confirmations.delete_file'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,7 +263,7 @@ function vendorMedia() {
|
||||
const response = await apiClient.delete(`/vendor/media/${this.selectedMedia.id}`);
|
||||
|
||||
if (response.ok) {
|
||||
this.showToast('Media deleted successfully', 'success');
|
||||
Utils.showToast(I18n.t('cms.messages.media_deleted_successfully'), 'success');
|
||||
this.showDetailModal = false;
|
||||
this.selectedMedia = null;
|
||||
await this.loadMedia();
|
||||
@@ -351,9 +354,9 @@ function vendorMedia() {
|
||||
copyToClipboard(text) {
|
||||
if (!text) return;
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
this.showToast('URL copied to clipboard', 'success');
|
||||
Utils.showToast(I18n.t('cms.messages.url_copied_to_clipboard'), 'success');
|
||||
}).catch(() => {
|
||||
this.showToast('Failed to copy URL', 'error');
|
||||
Utils.showToast(I18n.t('cms.messages.failed_to_copy_url'), 'error');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user