librepods icon indicating copy to clipboard operation
librepods copied to clipboard

linux(i18n): add Turkish translations

Open muminkoykiran opened this issue 1 month ago • 1 comments

Summary

  • Add Qt Linguist translation infrastructure for Linux app
  • Wrap UI strings with qsTr() in QML files
  • Wrap menu strings with tr() in C++ files
  • Add automatic locale detection via QTranslator
  • Create Turkish translation file (librepods_tr.ts)

Changes

  • CMakeLists.txt: Added Qt LinguistTools and translation build configuration
  • main.cpp: Added QTranslator loader for automatic system locale detection
  • Main.qml: Wrapped all user-facing strings with qsTr()
  • trayiconmanager.cpp: Wrapped tray menu strings with tr()
  • translations/librepods_tr.ts: Turkish translations for all UI elements

Translations include

  • Connection status (Connected/Disconnected)
  • Noise control modes (Off, Noise Cancellation, Transparency, Adaptive)
  • Settings page labels and options
  • Tray menu items
  • System notifications

Note

This also sets up the i18n infrastructure for future translations in other languages.

Summary by CodeRabbit

  • New Features

    • Added localization support and included a Turkish translation so the UI can display in Turkish.
    • App now detects the system language at startup and loads available translations automatically.
  • Chores

    • Translation files are built and installed with the application so translated resources are deployed alongside the app.

✏️ Tip: You can customize this high-level summary in your review settings.

muminkoykiran avatar Dec 08 '25 18:12 muminkoykiran

[!NOTE]

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The PR adds i18n: build integration for Qt Linguist tools, wraps UI strings with qsTr()/tr() in QML and C++, loads translations at runtime from multiple locations, and adds a Turkish translation TS file.

Changes

Cohort / File(s) Summary
Build: CMake i18n
linux/CMakeLists.txt
Adds LinguistTools to Qt components, defines TS_FILES, invokes qt_add_translations(...), and installs generated .qm files.
QML string localization
linux/Main.qml
Wraps user-facing strings with qsTr() across the UI (labels, buttons, tooltips, segmented controls). No logic changes.
C++ string localization & runtime loading
linux/trayiconmanager.cpp, linux/main.cpp
Wraps UI strings in tr() in the tray manager; main.cpp now loads and installs a QTranslator based on system locale from multiple search paths.
Translation resource
linux/translations/librepods_tr.ts
New Qt Linguist TS file providing Turkish (tr_TR) translations for contexts: Main, TrayIconManager, AirPodsTrayApp.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • Inspect main.cpp locale detection and ordered search paths for loading .qm files.
  • Verify CMakeLists.txt qt_add_translations() usage and install target correctness.
  • Spot-check Main.qml and trayiconmanager.cpp to ensure all visible strings are wrapped and contextually correct.
  • Review librepods_tr.ts for completeness and matching source strings.

Poem

🐰 I hopped through strings and stitched them new,
qsTr and tr hummed a soft “merhaba” too,
From tray to main I nibbled every line,
Now Turkish blooms where UI words shine. 🌸

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Turkish translations infrastructure and Turkish translation files to the Linux application.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35381062e00f29affc149fed3e73eb70451bcaef and b63886f4e94c2f9372e91ea7177001a9b088bc58.

📒 Files selected for processing (1)
  • linux/main.cpp (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • linux/main.cpp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Dec 08 '25 18:12 coderabbitai[bot]

Thank you!

BTW, the QT version is not actively worked on (#241)...

kavishdevar avatar Dec 10 '25 01:12 kavishdevar