Skip to content

Conversation

@anime-shed
Copy link

  • Introduce internationalization (i18n) infrastructure:

    • Add i18n scaffolding and translation resource loading utilities.
    • Provide runtime locale detection and a language switcher component.
    • Wire common UI strings through translation keys to enable multi-language support.
  • Add configuration UI for the shell:

    • New settings panel to configure shell preferences (appearance, behavior, and locale).
    • Persist user preferences and apply them at runtime.
    • Accessible, responsive controls integrated into the shell UI.
  • Implementation details:

    • Register i18n provider at the app root and update components to use localized strings.
    • Add helper functions for retrieving and updating locale and other settings.
    • Include basic tests and example translation resources to validate integration.
  • Notes:

    • No breaking changes to existing public APIs.
    • Future work: expand translation coverage, add additional locales, and refine UX for preference syncing.
      Allow english translation #299

@anime-shed
Copy link
Author

{A83149BC-02EC-48F8-84FA-E4FEB63EBAC5} {79A3D263-BE26-4350-84AF-A50D0B2056EE}

- Introduce internationalization (i18n) infrastructure:
  - Add i18n scaffolding and translation resource loading utilities.
  - Provide runtime locale detection and a language switcher component.
  - Wire common UI strings through translation keys to enable multi-language support.

- Add configuration UI for the shell:
  - New settings panel to configure shell preferences (appearance, behavior, and locale).
  - Persist user preferences and apply them at runtime.
  - Accessible, responsive controls integrated into the shell UI.

- Implementation details:
  - Register i18n provider at the app root and update components to use localized strings.
  - Add helper functions for retrieving and updating locale and other settings.
  - Include basic tests and example translation resources to validate integration.

- Notes:
  - No breaking changes to existing public APIs.
  - Future work: expand translation coverage, add additional locales, and refine UX for preference syncing.
@std-microblock
Copy link
Owner

Thanks! I'm busy working on another project so it might take a few days for me to review this PR.

@std-microblock
Copy link
Owner

Is the work done by LLMs, btw?

@anime-shed
Copy link
Author

Yes, you can go through the process I did on my repo. Since C and C++ side is way out of my league.

@std-microblock
Copy link
Owner

Yes, you can go through the process I did on my repo. Since C and C++ side is way out of my league.

Can you fix the three points I mentioned?

@anime-shed
Copy link
Author

@std-microblock I am not able to find your comments?
{6A20C813-2A0E-4B0C-94D4-CD07AA0A390E}

Can you guide me where to find it?

@std-microblock
Copy link
Owner

image It's here

@anime-shed
Copy link
Author

{D63812FF-4C0E-476D-A5B0-38003632CB9E} What the hell is github upto I can't seem to find it!!!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird to extract the i18n file every time into the disk. If it's not configurable, why don't load it in-memory? If not, why override it every time?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a short tearm approach since I though if i18n to be vaible for this project it will be required to move into a seperate repo as most project do for multi-language support to their apps. That will requires dropdowns and other things in UI for both config and the main breeze app. Also this helps a user to play with the translations present in the config folder, future scope should be extract only the required language, in memory or disk to keeps things less cluttered on the user end

Copy link
Owner

@std-microblock std-microblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@std-microblock
Copy link
Owner

what about now

@anime-shed
Copy link
Author

{0B46E12B-325D-475F-8100-8AFB0004B644} Thanks now it is here!

Replace the JSON parsing backend from yyjson to reflect-cpp (rfl) for 
locale file handling, simplifying the codebase with better type safety 
and more ergonomic API.

Changes:
- Introduce LocaleFile and LocaleMetadata structures with rfl annotations
  for declarative JSON parsing in i18n_manager.cc
- Migrate load_locale() and load_plugin_locales() to use rfl::json::read
  with improved error messages and validation
- Add js_traits specializations for std::map and std::unordered_map in
  quickjspp.hpp to support generic map conversions
- Remove custom map<string, Value> traits from binding_qjs.h (now handled
  by generic quickjspp.hpp traits)
- Remove yyjson dependency from xmake.lua
- Clean up config_page exports by removing unused languages identifier

The new reflect-cpp approach provides compile-time type checking and
reduces boilerplate while maintaining all existing security checks
(path validation, canonicalization) and plugin key override protection.
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.

2 participants