Skip to content

Add Polish and a string catalog for translations - #26

Merged
pszypowicz merged 2 commits into
mainfrom
polish-localization
Nov 7, 2026
Merged

pszypowicz merged 2 commits into
mainfrom
polish-localization

Conversation

@pszypowicz

@pszypowicz pszypowicz commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Adds localization to MicGuard, with Polish as the first translation, and moves VERSION to 1.1.0.

How translations work. User-facing text lives in Resources/Localizable.xcstrings, a String Catalog keyed by the English text. SwiftUI literals are picked up as they are. The AppKit menu titles, window titles, info popovers, and strings chosen by a ternary now go through String(localized:) or Text literals, and device names stay verbatim.

Keeping the catalog in step with the code. scripts/sync-strings.sh builds with the compiler's string extraction, updates the catalog, and rewrites it in the layout xcstringstool writes. CI runs it with --check, so text added in code can't merge without a catalog entry.

Bundling. bundle.sh compiles the catalog into <language>.lproj folders and lists the languages in CFBundleLocalizations, so adding a language only touches the catalog. It also adds an empty en.lproj, because the catalog compiles no English folder and without one a user whose languages are "English (UK), Polish" would get Polish. Without Xcode, bundle.sh builds English only with a warning, and notarize-release.sh refuses a release that has no translations.

AGENTS.md gains a Localization section that covers adding a string and adding a language.

The Polish strings use the terms macOS itself uses, taken from its own string tables. Examples are "Otwieraj podczas logowania" for opening at login and "MicGuard…" for the About menu item, and the About window title gets its own key because of that. AGENTS.md explains when to split a key and where macOS keeps its translations.

I launched the bundle with four language lists. pl and de, pl show Polish, en-GB, pl and de show English, and device names stay as they are. I also checked that the longer Polish approval note and its button fit in Settings.

User-facing text lives in Resources/Localizable.xcstrings, keyed by the
English text, with Polish as the first translation. SwiftUI literals are
picked up as they are, and the AppKit menu titles, window titles, info
popovers, and strings chosen by a ternary now go through
String(localized:) or Text literals. Device names stay verbatim.

scripts/sync-strings.sh updates the catalog from the compiler's string
extraction and rewrites it in the layout xcstringstool writes. CI runs
it with --check, so text added in code can't merge without a catalog
entry.

bundle.sh compiles the catalog into <language>.lproj folders, adds an
empty en.lproj so English stays available to users who prefer it over
another supported language, and lists the languages in
CFBundleLocalizations. Without Xcode it builds English only with a
warning, and notarize-release.sh refuses a release without translations.

AGENTS.md gains a Localization section, and VERSION moves to 1.1.0.
The Polish strings now follow the terms macOS uses in its own string
tables: "Otwieraj podczas logowania" for opening at login, the pane name
"Rzeczy i rozszerzenia otwierane podczas logowania" in the approval
note, "Otwórz Rzeczy otwierane podczas logowania" for the button, and
"MicGuard…" for the About menu item.

The About window title gets its own key, because "MicGuard…" reads
oddly as a window title. AGENTS.md explains when to split a key like
that and where macOS keeps its translations.
@pszypowicz
pszypowicz marked this pull request as ready for review November 7, 2026 12:10
@pszypowicz
pszypowicz merged commit f2eaf47 into main Nov 7, 2026
2 checks passed
@pszypowicz
pszypowicz deleted the polish-localization branch November 7, 2026 12:10
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