Add German and Swiss German translations#20
Conversation
Initialize gettext at startup, fix the gettext domain mismatch in po/meson.build, clean up stale entries in POTFILES.in, and add full German (de) and Swiss German (de_CH) translations following GNOME translation guidelines. Adds a helper script for testing local builds without touching the system installation.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis PR adds internationalization (i18n) support to the Keymaker application with German and Swiss German translations. The application is updated to initialize locale settings at startup, build configuration is modified to identify the translation textdomain and register available language locales, two complete translation files are provided, and local development tooling is added to test translations without system installation. ChangesInternationalization and Translations
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/run-local.sh`:
- Around line 21-33: The script currently treats LANG_ARG as control input but
then forwards it to the app via exec "$PREFIX/bin/keymaker" "$@", so locale
selectors leak into the app argv; update the script to consume the locale
selector before exec by removing the first positional argument (use shift after
setting LANG_ARG or pass the arguments starting at $2 when calling keymaker) so
that LANG_ARG is not passed to keymaker; reference symbols to change: LANG_ARG,
the case ... esac block, and the exec "$PREFIX/bin/keymaker" "$@" invocation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3df8f22b-84c9-437e-87e8-a48f842ef8ee
📒 Files selected for processing (8)
.gitignorepo/LINGUASpo/POTFILES.inpo/de.popo/de_CH.popo/meson.buildscripts/run-local.shsrc/Main.vala
shift the locale selector out of argv after consuming it, so that './scripts/run-local.sh de' no longer passes 'de' as a CLI argument to the keymaker binary. Addresses review feedback on the run-local.sh wrapper
Summary
Adds full German (
de) and Swiss German (de_CH) translations, and fixesthree pre-existing bugs that prevented localization from working at all —
even the existing Spanish translation never loaded at runtime.
What's included
Bug fixes (the reason no translation ever worked)
src/Main.vala— gettext was never initialized. The app definedGETTEXT_PACKAGEandLOCALEDIRinConfig.vala.in, butmain()nevercalled
Intl.bindtextdomain()/Intl.textdomain(). Without those calls,gettext has no idea where to look for
.mofiles, so every_("…")justreturned the English msgid.
po/meson.build— gettext domain was set tokeymaker, but the restof the project (
meson.project_name()inmeson.build,gettext-domainin
gschema.xml.in) useskeysmith. Result: the build producedkeymaker.mo, but the binary asked gettext forkeysmith.mo. Theinline comment in
meson.build:47explicitly notes that these mustmatch — they didn't.
po/POTFILES.in— referenced 40+ files that no longer exist (cloud,diagnostics, rotation, tunnels features that were removed). Any
meson compile keysmith-potwould fail on the first missing file.Now contains only paths that actually exist in the tree.
New translations
po/de.po— complete German translation (604 strings) followingGNOME translation guidelines:
Tastenkürzel, Einstellungen, etc.)
_) moved to natural German letters(e.g.
_Quit→_Beenden)msgstr[0]andmsgstr[1]po/de_CH.po— Swiss German variant. Derived fromde.powithßreplaced by
ssthroughout (Grösse, standardmässig, routinemässig, …).po/LINGUAS— registers bothdeandde_CHso Meson builds them.Tooling & hygiene
scripts/run-local.sh— convenience wrapper for testing a locallyinstalled build (
meson install --prefix=$(pwd)/install) withouttouching the system. Sets
LANG/LANGUAGE,GSETTINGS_SCHEMA_DIRand
XDG_DATA_DIRScorrectly, and acceptsde,de_CH,en, orany other locale code as its argument. Useful for translation review.
.gitignore— addsinstall/(alongside the existingbuilddir/)so
meson install --destdir=…output never gets committed.Testing
Built with the development profile (so it doesn't collide with the
production Flatpak's D-Bus app-id) and confirmed both German and Swiss
German render correctly at runtime:
Follow-ups (not in this PR)
po/es.po) references stale Python paths(
keymaker/ui/window.py) and predates the Vala rewrite. It probablyneeds a refresh against the new
keysmith.pot.Summary by CodeRabbit
New Features
Chores