Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This pull request implements comprehensive internationalization (i18n) support for the POS application.

Backend Changes:

  • Translation Management: Enhanced back/app/messages.py to store and retrieve localized strings for 6 languages: English, Spanish, Catalan, German, Chinese, and Hindi.
  • Language Detection: Added back/app/language_service.py to parse the Accept-Language header or lang query parameter, normalizing language codes (e.g., zh -> zh-CN).
  • Route Updates: Refactored back/app/main.py and back/app/inventory_routes.py to inject the detected language and use get_message() for generating HTTPException details, ensuring API errors are returned in the user's preferred language.

Frontend Changes:

  • Translation Files: Updated JSON files in front/public/i18n/ to include missing translation keys for:
    • Inventory Categories (e.g., INVENTORY.CATEGORIES.INGREDIENTS)
    • Units of Measure (e.g., INVENTORY.UNITS.PIECE)
    • Generic Catalog labels (e.g., CATALOG.ALL_CATEGORIES)
    • Common terms like NONE.
  • Component Updates:
    • ProductsComponent: Now uses translate pipe for category filters and translateService for 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

- Updated backend `messages.py` with translation keys for all supported languages (en, es, ca, de, zh-CN, hi).
- Implemented `language_service.py` to detect requested language from `Accept-Language` header or query param.
- Updated backend API routes (`main.py`, `inventory_routes.py`) to return localized error messages.
- Updated frontend translation files (`front/public/i18n/*.json`) with missing keys for inventory, units, and categories.
- Updated Angular components (`products.component.ts`, `inventory-items.component.ts`) to use localized strings for dynamic content and errors.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Updated backend `messages.py` with ALL missing translation keys for `main.py` and `inventory_routes.py`.
- Fixed `back/app/language_service.py` to correctly read `Accept-Language` header using `Header` instead of `Query`.
- Ensured `front/public/i18n/*.json` files are 100% synchronized, filling missing keys in es, ca, de, zh-CN, and hi.
- Verified all code changes and translations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant