Skip to content

Feat/desktop i18n currency - #11

Closed
nachogarglez wants to merge 3 commits into
morfredus:mainfrom
nachogarglez:feat/desktop-i18n-currency
Closed

nachogarglez wants to merge 3 commits into
morfredus:mainfrom
nachogarglez:feat/desktop-i18n-currency

Conversation

@nachogarglez

@nachogarglez nachogarglez commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This draft PR adds full desktop internationalization support and currency selection to ComponentHub.

Added

  • Qt Linguist translation catalogs:
    • translations/componenthub_en.ts
    • translations/componenthub_fr.ts
  • English and French desktop interface support.
  • Persistent language selection in Settings.
  • Automatic language detection:
    • French for all French regional locales.
    • English for other locales by default.
  • EUR, USD and GBP currency selection.
  • Currency defaults based on the operating system locale.
  • Localized price display in the inventory and component editor.
  • Localized initial reference-data values when creating a new database.

Error Handling

Core and platform layers remain Qt-free. Technical error codes are returned by:

  • SQLite initialization
  • HTTP client
  • TAR archive handling
  • Synchronization service

The UI translates those errors according to the selected language.

Build And Packaging

  • lrelease is now required during CMake configuration.
  • Translation catalogs are compiled into .qm resources.
  • Added Qt Linguist dependencies to the build documentation.
  • Updated contributor documentation with the translation workflow.

Verification

  • Clean build completed with GCC 14.
  • English catalog generated without unfinished entries.
  • French catalog generated successfully, using French source text as fallback where appropriate.
  • Normal build and clean build verified.
  • git diff --check passes.

This PR is intentionally opened as a draft for review of the translation architecture, terminology, and remaining UI wording.

Add Qt Linguist catalogs, persistent language selection, regional defaults, localized reference data, and EUR/USD/GBP display settings. Embed the generated catalogs in the desktop executable.
Keep domain and platform layers free of Qt while returning stable error codes. Translate SQLite, HTTP, TAR, and synchronization failures at the UI boundary.
Document Qt Linguist dependencies, catalog maintenance, and the unreleased internationalization and currency features.
@nachogarglez
nachogarglez marked this pull request as draft October 10, 2026 18:45
@morfredus
morfredus self-requested a review October 22, 2026 20:46
@morfredus morfredus self-assigned this Oct 22, 2026
morfredus added a commit that referenced this pull request Oct 22, 2026
Release 1.10.0. Based on the work of Nacho Garcia in PR #11.

Co-authored-by: Nacho Garcia <34654218+nachogarglez@users.noreply.github.com>
@morfredus

Copy link
Copy Markdown
Owner

Hi Nacho,

First of all, thank you, and please excuse the long silence. You opened this pull request
about two weeks ago and I should have answered much sooner. I had my head down in the port
of Ant Renamer to Qt, and ComponentHub had to wait. That is not a good reason to leave a
contribution unanswered, and I am sorry.

I read the whole PR and tested it. The French/English catalogs, the language that sticks
after a restart, the EUR/USD/GBP selector and the way you kept the core and platform layers
free of Qt by returning error codes: this is careful, clean work, and it is exactly the kind
of change the project was missing.

Because the sandbox and the public repository have separate histories, I could not merge
the branch as is (it conflicted with main). I replayed your three commits on top of 1.9.13,
resolved two small conflicts (the case-insensitive inventory sorting and the changelog), and
released the result as 1.10.0. You are credited in the About dialog, in both READMEs, in the
changelog, and as co-author of the commit, so you appear among the contributors.

Release: https://github.com/morfredus/ComponentHub/releases/tag/v1.10.0

I am closing this PR since its content is now in main through 1.10.0. This is not a
rejection, quite the opposite. If you spot a rough edge in the translations or want to go
further (other languages, more currencies), please open an issue or another PR, I will answer
faster this time.

Thank you again for the time you put into this.

morfredus

@morfredus morfredus closed this Oct 22, 2026
@nachogarglez

Copy link
Copy Markdown
Contributor Author

Thank you so much! No worries at all, it's perfect! Now I'll be able to sync my fork with this.

I didn't ask you before opening the PR because, since you were asking for translations in the documentation, I thought it was natural to translate the application as well.

I needed to do it for myself anyway, since I don't understand French (I'm Spanish).

I'm working on another change that I need for myself, but this time I'd rather discuss it with you and let you have a look at it in my fork before opening a PR, because it's a new feature.

I'm adding the ability to print standard labels for selected components. This is very important for me because I have a lot of SMD components stored in small boxes, and if I don't label them, I end up losing track of what they are.

But I completely understand that you may not be interested in this feature, or that you might prefer to implement it in a different way.

So how about this: once I've synced my fork and pushed the feature, I'll let you know so you can take a look, and then we can decide whether it's something you'd be interested in merging or not.

Best regards, and thanks again. Your software may be small, but it's very useful, there was definitely a need for something like this.

Nacho

@morfredus

Copy link
Copy Markdown
Owner

Hi Nacho,

Actually, your proposal is particularly interesting to me because printing labels is something I've already been considering for ComponentHub's future development!

I'd like to eventually go a bit further and add QR code support, so that components could be identified and retrieved directly in ComponentHub by scanning their labels. This could be done using a regular QR code scanner connected to a PC, or perhaps even a small ESP32-based handheld device.

Your work could therefore be a great starting point for something I've already had in mind. I'd like to have label printing integrated into ComponentHub, with support for different label formats and eventually QR codes as well.

Please go ahead and develop your feature in your fork. I'll take a close look at your development branch once you have something ready, and we can discuss how best to integrate it into ComponentHub and leave room for these future possibilities.

And don't worry if I don't get back to you immediately! I'm quite busy with Ant Renamer Qt at the moment, but I'll review your work with interest as soon as I can.

Thanks again for taking the initiative and for explaining your idea before opening a PR. It's great to see ComponentHub inspiring this kind of contribution!

Best regards,
Fred

@nachogarglez
nachogarglez deleted the feat/desktop-i18n-currency branch October 26, 2026 19:13
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