Skip to content

Add German localization - #139

Merged
viktorstrate merged 2 commits into
viktorstrate:mainfrom
ttimpe:german-translation
Nov 24, 2026
Merged

viktorstrate merged 2 commits into
viktorstrate:mainfrom
ttimpe:german-translation

Conversation

@ttimpe

@ttimpe ttimpe commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Adds a complete German translation and the plumbing to keep translations in sync.

How strings are stored

All UI code lives in the Swift package, and SwiftUI's Text("…"), Button("…") and String(localized:) look up translations in the app's main bundle by default. So all strings go into a single catalog in the app target, Mactrix/Localizable.xcstrings, and existing call sites keep working unchanged. Package.swift now sets defaultLocalization: "en" so the compiler extracts strings from package targets.

Xcode only syncs a catalog with its own target's strings, so scripts/sync-strings.sh builds the app and runs xcstringstool sync with the package targets' .stringsdata. The README explains when to run it.

Code changes

  • Made hard-coded AppKit labels, tooltips, menu items, alerts, notification texts and timeline event descriptions localizable.
  • Room preview: separate full sentences for rooms and spaces instead of interpolating "room"/"space", so articles and cases can be translated.
  • Plural variations for counts (members, read receipts, thread replies).
  • StateEventSummaryFormatter now uses full-sentence templates with placeholders instead of joining English fragments. Translations can reorder names and choose singular/plural verb forms ("Alice ist beigetreten" / "Alice und Bob sind beigetreten"), and names stay clickable segments. English output is unchanged: all existing formatter tests pass, and there's a new test for reordered placeholders.
  • Emoji picker category names, the composer placeholder, and HH:mm timestamps now use a locale-aware format.
  • InfoPlist.xcstrings for the contacts usage description; de added to known regions.

Not covered

  • SwiftUI's built-in InspectorCommands menu item shows as "Informationen Show" in German. It comes from SwiftUI's own localization, not this catalog.
  • Emoji names and search keywords, and SAS verification emoji names, stay English. They come from bundled CLDR data and the Rust SDK.

Testing

  • xcodebuild test passes.
  • Ran the app with -AppleLanguages "(de)" and checked the menus, sidebar and all Settings tabs; English is unchanged.

@viktorstrate viktorstrate left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks great! I will have an attempt to translate the application to danish after this is merged 😊

I think it is just fine to keep emoji translations simple for now. We discussed on the matrix channel that most of the currently manually implemented emoji package could be replaced by the EmojiKit library. That library contains its own localizations for all the emojis, category names, and keywords.

I've left a single comment that we need to resolve before it's ready to merge.

Move all user-facing strings into a single string catalog in the app
target (Mactrix/Localizable.xcstrings), since the package UI code looks
up strings in the main bundle, and translate them to German. Add
scripts/sync-strings.sh to pull new package strings into the catalog.

Make previously hard-coded AppKit labels, tooltips, alerts, notification
texts and event descriptions localizable. Split room/space sentences in
the room preview, and use plural variations for counts.

Rewrite the state event summary formatter around full-sentence templates
with placeholders, so translations can reorder names and choose the verb
form for one or several people while names stay clickable.
@viktorstrate
viktorstrate merged commit 359ba47 into viktorstrate:main Nov 24, 2026
3 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.

2 participants