Skip to content

Add bilingual support (English/Greek) with live language switching#25

Merged
michadasis merged 5 commits into
open-source-uom:mainfrom
YatesMold:main
Jun 14, 2026
Merged

Add bilingual support (English/Greek) with live language switching#25
michadasis merged 5 commits into
open-source-uom:mainfrom
YatesMold:main

Conversation

@YatesMold

Copy link
Copy Markdown
Contributor

Added Greek translation support using Qt Linguist (tr(), .ts/.qm).
Language switcher in the status bar, choice saved across sessions via QSettings.

Key changes:

  • Decoupled university/department display labels from logic keys using Qt::UserRole so that translation never affects resource paths or control flow comparisons
  • Replaced English prefix matching on status messages with a dedicated status_update signal, removing the dependency on untranslated string content
  • Wrapped all user-facing strings in tr() using .arg() for proper sentence structure in both languages
  • Added qt_add_translations to CMake with LinguistTools, fixed stale resources.qrc path (resources/ -> include/resources/)
  • Added applyTranslator() helper for clean QTranslator install/remove
  • Added retranslate() and changeEvent() for live UI refresh on language switch
  • Greek translations provided for all UI strings, university and department names

Fixes #16

Implemented i18n infrastructure using Qt Linguist pipeline (tr(), .ts/.qm files).
Language can be switched at runtime via a status bar dropdown and is persisted
across sessions using QSettings.

Key changes:
- Decoupled university/department display labels from logic keys using Qt::UserRole
  so that translation never affects resource paths or control flow comparisons
- Replaced English prefix matching on status messages with a dedicated
  status_update signal, removing the dependency on untranslated string content
- Wrapped all user-facing strings in tr() using .arg() for proper sentence
  structure in both languages
- Added qt_add_translations to CMake with LinguistTools, fixed stale resources.qrc
  path (resources/ -> include/resources/)
- Added applyTranslator() helper for clean QTranslator install/remove
- Added retranslate() and changeEvent() for live UI refresh on language switch
- Greek translations provided for all UI strings, university and department names
@TolisSth

Copy link
Copy Markdown
Collaborator
Run cmake -B build
-- The CXX compiler identification is GNU 13.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Could NOT find Qt6LinguistTools (missing: Qt6LinguistTools_DIR)
CMake Error at CMakeLists.txt:7 (find_package):
  Found package configuration file:

    /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake

  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find required Qt component "LinguistTools".

  Expected Config file at
  "/usr/lib/x86_64-linux-gnu/cmake/Qt6LinguistTools/Qt6LinguistToolsConfig.cmake"
  does NOT exist



  Configuring with --debug-find-pkg=Qt6LinguistTools might reveal details why
  the package was not found.

  Configuring with -DQT_DEBUG_FIND_PACKAGE=ON will print the values of some
  of the path variables that find_package uses to try and find the package.



-- Configuring incomplete, errors occurred!
Error: Process completed with exit code 1.

This shows up, I suggest you take a look at your CMake or run the command as instructed by cppcheck

@YatesMold

Copy link
Copy Markdown
Contributor Author

Το σφάλμα δεν είναι στο CMake. Το qt6-tools-dev δεν εγκαθίσταται αυτόματα
στο Debian/Ubuntu. Το έχω προσθέσει στο README, το build θα δουλέψει μετά από:

sudo apt install build-essential cmake qt6-base-dev qt6-tools-dev qt6-tools-dev-tools policykit-1

@TolisSth

Copy link
Copy Markdown
Collaborator

You should go ahead and add that in the build.yml so we can get the .deb file right from the CI pipeline

@michadasis

Copy link
Copy Markdown
Contributor

For arch?

@YatesMold

Copy link
Copy Markdown
Contributor Author

Έχω προσθέσει το qt6-tools-dev στο build.yml και διόρθωσα και το path του icon.

@YatesMold

Copy link
Copy Markdown
Contributor Author

Για Arch, το qt6-tools που αναφέρεται ήδη στο README περιλαμβάνει τα απαραίτητα, οπότε δεν χρειάζεται αλλαγή εκεί.

@michadasis

Copy link
Copy Markdown
Contributor

Είσαι σίγουρος ότι το path του icon ήταν λανθασμένο;

@michadasis

Copy link
Copy Markdown
Contributor

Για επόμενα pull requests να ξέρεις οτι θα ηταν καλύτερο να χωρίζονται τα fixes, αλλα αυτη τη φορα δεν πειράζει, εκτιμάμαι πολυ την συμμετοχή σου

@YatesMold

Copy link
Copy Markdown
Contributor Author

Έγινε κατά λάθος. Βασίστηκα στο output του find που έδειξε ./include/resources/resources.qrc και υπέθεσα ότι ήταν ήδη εκεί.
Θέλετε να το κάνω revert στο αρχικό path;
Και ευχαριστώ για την παρατήρηση, θα το έχω υπόψη για τα επόμενα PR!

@michadasis

Copy link
Copy Markdown
Contributor

Αμα μπορείς ναι

@YatesMold

Copy link
Copy Markdown
Contributor Author

Έγινε, το resources επέστρεψε στη ρίζα του project.

Comment thread .vscode/settings.json Outdated
@TolisSth TolisSth requested a review from michadasis June 14, 2026 13:35
@TolisSth

Copy link
Copy Markdown
Collaborator

Seems fine, hope it doesn't crash the CI pipeline

@TolisSth TolisSth self-requested a review June 14, 2026 13:52

@michadasis michadasis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

build.yml remains unchanges with only a minor dependency addition, code seems to be working, looks pretty okay to me

@michadasis michadasis merged commit 52337b3 into open-source-uom:main Jun 14, 2026
2 checks passed
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.

Add bilingual support

3 participants