Skip to content

Add German and Swiss German translations#20

Open
srueegger wants to merge 2 commits into
tobagin:mainfrom
srueegger:add-german-translation
Open

Add German and Swiss German translations#20
srueegger wants to merge 2 commits into
tobagin:mainfrom
srueegger:add-german-translation

Conversation

@srueegger
Copy link
Copy Markdown

@srueegger srueegger commented May 16, 2026

Summary

Adds full German (de) and Swiss German (de_CH) translations, and fixes
three 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 defined
    GETTEXT_PACKAGE and LOCALEDIR in Config.vala.in, but main() never
    called Intl.bindtextdomain() / Intl.textdomain(). Without those calls,
    gettext has no idea where to look for .mo files, so every _("…") just
    returned the English msgid.

  • po/meson.build — gettext domain was set to keymaker, but the rest
    of the project (meson.project_name() in meson.build, gettext-domain
    in gschema.xml.in) uses keysmith. Result: the build produced
    keymaker.mo, but the binary asked gettext for keysmith.mo. The
    inline comment in meson.build:47 explicitly notes that these must
    match — 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-pot would 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) following
    GNOME translation guidelines:

    • Infinitive form throughout (no direct "Sie"-address)
    • German typographic quotes „…"
    • Unicode ellipsis (…) instead of three dots
    • Standard GNOME German vocabulary (Schlüssel, Sicherung, Passphrase,
      Tastenkürzel, Einstellungen, etc.)
    • Accelerator keys (_) moved to natural German letters
      (e.g. _Quit_Beenden)
    • Plural forms filled in for both msgstr[0] and msgstr[1]
  • po/de_CH.po — Swiss German variant. Derived from de.po with ß
    replaced by ss throughout (Grösse, standardmässig, routinemässig, …).

  • po/LINGUAS — registers both de and de_CH so Meson builds them.

Tooling & hygiene

  • scripts/run-local.sh — convenience wrapper for testing a locally
    installed build (meson install --prefix=$(pwd)/install) without
    touching the system. Sets LANG/LANGUAGE, GSETTINGS_SCHEMA_DIR
    and XDG_DATA_DIRS correctly, and accepts de, de_CH, en, or
    any other locale code as its argument. Useful for translation review.

  • .gitignore — adds install/ (alongside the existing builddir/)
    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:

meson setup builddir --prefix="$(pwd)/install" -Dprofile=development
meson install -C builddir
./scripts/run-local.sh de       # German
./scripts/run-local.sh de_CH    # Swiss German
./scripts/run-local.sh en       # English (original)

Follow-ups (not in this PR)

  • The Spanish translation (po/es.po) references stale Python paths
    (keymaker/ui/window.py) and predates the Vala rewrite. It probably
    needs a refresh against the new keysmith.pot.

Summary by CodeRabbit

  • New Features

    • German and Swiss German language translations are now available, providing full localization of application menus, dialogs, notifications, and user interface text.
  • Chores

    • Updated translation infrastructure and build configuration; integrated internationalization initialization and added development utilities for local testing.

Review Change Stack

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Warning

Rate limit exceeded

@srueegger has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 2 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d5f261d-710a-4817-9164-0023902b2ed3

📥 Commits

Reviewing files that changed from the base of the PR and between f7965e8 and e327d8d.

📒 Files selected for processing (1)
  • scripts/run-local.sh
📝 Walkthrough

Walkthrough

This 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.

Changes

Internationalization and Translations

Layer / File(s) Summary
I18n initialization and build configuration
src/Main.vala, po/meson.build, po/LINGUAS, po/POTFILES.in
Application startup now calls Intl.setlocale, Intl.bindtextdomain, Intl.bind_textdomain_codeset, and Intl.textdomain before creating the application. Build configuration updates the gettext identifier from keymaker to keysmith, registers de and de_CH language locales in LINGUAS, and updates POTFILES.in to specify the exact source files whose strings are extracted for translation.
German translation strings
po/de.po
Complete German translation file with msgid/msgstr entries covering application metadata, GSettings schema descriptions, window and menu labels, SSH key management workflows, backup and recovery operations, preferences, terminal options, host configuration UI, and all user-facing dialogs, confirmations, error messages, and status notifications.
Swiss German translation strings
po/de_CH.po
Complete Swiss German translation file providing equivalent msgstr translations for all application text, including proper plural forms for counts and the translator credits entry.
Local development tooling
scripts/run-local.sh, .gitignore
New bash script sets up environment variables and runs the locally-installed keymaker binary from the install/ directory with optional locale configuration; .gitignore updated to exclude the local install artifacts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A Rabbit's I18n Song

With German and Swiss tongues now aligned,
Locales are bound and strings extracted refined,
The rabbit hops through translation files complete,
Where textdomain and startup together greet! 🌍✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add German and Swiss German translations' directly describes the main change: adding two complete translation files (de.po and de_CH.po) and supporting infrastructure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a60d81 and f7965e8.

📒 Files selected for processing (8)
  • .gitignore
  • po/LINGUAS
  • po/POTFILES.in
  • po/de.po
  • po/de_CH.po
  • po/meson.build
  • scripts/run-local.sh
  • src/Main.vala

Comment thread scripts/run-local.sh
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
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.

1 participant