feat: add module-specific locale support for i18n
Enhance the self-contained module architecture with locale/translation support:
ModuleDefinition changes:
- Add locales_path attribute for module-specific translations
- Add get_locales_dir() helper method
- Include locales in validate_structure() check
i18n module changes (app/utils/i18n.py):
- Add get_module_locale_dirs() to discover module locales
- Update load_translations() to merge module translations with core
- Module translations namespaced under module code (e.g., cms.title)
- Add _deep_merge() helper for nested dictionary merging
- Add _load_json_file() helper for cleaner JSON loading
CMS module locales:
- Add app/modules/cms/locales/ with translations for all 4 languages
- en.json, fr.json, de.json, lb.json with CMS-specific strings
- Covers: pages, page editing, SEO, navigation, publishing, homepage
sections, media library, themes, actions, and messages
Usage in templates:
{{ _("cms.title") }} -> "Content Management" (en)
{{ _("cms.pages.create") }} -> "Créer une page" (fr)
{{ _("cms.publishing.draft") }} -> "Entwurf" (de)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
126
app/modules/cms/locales/en.json
Normal file
126
app/modules/cms/locales/en.json
Normal file
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"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"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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."
|
||||
},
|
||||
"cta": {
|
||||
"title": "Call to Action Section",
|
||||
"main_title": "Title",
|
||||
"subtitle": "Subtitle",
|
||||
"buttons": "Buttons",
|
||||
"add_button": "Add Button"
|
||||
}
|
||||
},
|
||||
"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?"
|
||||
},
|
||||
"filters": {
|
||||
"all_pages": "All Pages",
|
||||
"all_platforms": "All Platforms",
|
||||
"search_placeholder": "Search pages..."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user