Add i18n support to KWin KCM: translate all strings, add translation infrastructure#169
Draft
Add i18n support to KWin KCM: translate all strings, add translation infrastructure#169
Conversation
…infrastructure Agent-Logs-Url: https://github.com/wheaney/breezy-desktop/sessions/8fe9c60c-e7d7-4df0-9454-93973ce81f5f Co-authored-by: wheaney <42350981+wheaney@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add i18n support for KCM app and translator files
Add i18n support to KWin KCM: translate all strings, add translation infrastructure
Mar 27, 2026
wheaney
requested changes
Mar 27, 2026
Owner
wheaney
left a comment
There was a problem hiding this comment.
For any strings that are identical to their python/GTK counterparts, please copy over the existing translations.
Agent-Logs-Url: https://github.com/wheaney/breezy-desktop/sessions/a8cb9e25-6fb9-4bdc-9d92-512d2069334f Co-authored-by: wheaney <42350981+wheaney@users.noreply.github.com>
Contributor
Author
Done in e84dee7. Found 20 strings shared between the KCM and Python/GTK PO files and copied all existing translations. Results by language:
The matched strings are: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The KCM app had no i18n support — strings were a mix of bare
QStringLiteral, Qt'str(), and KDE'si18n(), with no translation catalog, no tooling, and no translator workflow.C++ source fixes
KLocalizedString::setApplicationDomain("breezy_desktop_kwin")added at the top of the constructor, beforesetupUi(), so UI strings rendered byki18n_wrap_uiuse the correct catalogtr()→i18n()— 38 call sites:QObject::tr(),BreezyDesktopEffectConfig::tr(), and baretr()in lambdas;.arg()chains rewritten asi18n("…%1", arg)"%1 %2 connected","No device connected", and the version label were bareQStringLiteralwith no i18n at allshortcuts.h— shortcut action labelsChanged
actionTextfromQStringtoconst char*, wrapped values withI18N_NOOP()for extraction, and call site usesi18n(shortcut.actionText):UI files —
notr="true"for dynamic placeholdersStrings that C++ immediately overwrites at runtime don't belong in the catalog. Added
notr="true"to:breezydesktopeffectkcm.ui(overridden in constructor)comboAddVirtualDisplayitems1080p,1440p,Add custom…(combo is cleared and repopulated bypopulateResolutionCombo)1920/1080incustomresolutiondialog.ui(set by slidervalueChanged)ID/WxHplaceholders invirtualdisplayrow.ui(overwritten bysetInfo())Translation infrastructure
Mirrors the structure used by the Python/GTK UI:
kwin/po/LINGUASkwin/po/breezy_desktop_kwin.potkwin/po/<lang>/breezy_desktop_kwin.pomsgidpopulated,msgstrpre-filled where translations already exist in the Python/GTK UIkwin/bin/update_pot_filesextractrc→xgettext→msgmerge→msgfmtkwin/TRANSLATING.mdThe dev script uses
extractrc(fromkdesdk-scripts) to convert Qt Designer.uifiles into extractable C++ before runningxgettextwith full KDE keyword flags. Compiled.mofiles are excluded from git (kwin/po/*/LC_MESSAGES/in.gitignore) —ki18n_install(po)in CMake handles compilation at build time.TRANSLATING.mdcovers: how to translate a.pofile, how to add a new language, what to do after adding strings, and the do/don't for string marking in C++ and.uifiles.Pre-filled translations from the Python/GTK UI
20 strings are identical between the KCM and the Python/GTK UI. Existing translations for those strings have been copied into each language's KCM PO file so translators don't need to re-translate them:
1 day,1 hour,All displays follow mode,Curved display,Default,Disabled,Enable multi-tap detection,Flat,Follow mode,Height,Horizontal,No device connected,Rearrange displays,Remove custom resolution,Remove virtual displays on disable,Request a token,Verify token,Vertical,Width,less than an hourCoverage varies by language depending on what was already translated in the Python/GTK PO files (de, es, fr, it, ja, zh_CN got all 20; pt_BR got all 20; ru, sv, uk_UA got 10; pl got 0).
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.