Add Multi-language Support (i18n) for Backend and Frontend #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements comprehensive internationalization (i18n) support for the POS application.
Backend Changes:
back/app/messages.pyto store and retrieve localized strings for 6 languages: English, Spanish, Catalan, German, Chinese, and Hindi.back/app/language_service.pyto parse theAccept-Languageheader orlangquery parameter, normalizing language codes (e.g.,zh->zh-CN).back/app/main.pyandback/app/inventory_routes.pyto inject the detected language and useget_message()for generatingHTTPExceptiondetails, ensuring API errors are returned in the user's preferred language.Frontend Changes:
front/public/i18n/to include missing translation keys for:INVENTORY.CATEGORIES.INGREDIENTS)INVENTORY.UNITS.PIECE)CATALOG.ALL_CATEGORIES)NONE.ProductsComponent: Now usestranslatepipe for category filters andtranslateServicefor API error messages.InventoryItemsComponent: Replaced hardcoded string formatting for categories and units with dynamic translations using the new JSON structure.This ensures a consistent multi-language experience across both the UI and API responses.
PR created automatically by Jules for task 15334820750941838496 started by @wiatakillo