Repository navigation
Add Polish and a string catalog for translations - #26
Merged
Merged
Conversation
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.
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.
Adds localization to MicGuard, with Polish as the first translation, and moves
VERSIONto 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 throughString(localized:)orTextliterals, and device names stay verbatim.Keeping the catalog in step with the code.
scripts/sync-strings.shbuilds with the compiler's string extraction, updates the catalog, and rewrites it in the layoutxcstringstoolwrites. CI runs it with--check, so text added in code can't merge without a catalog entry.Bundling.
bundle.shcompiles the catalog into<language>.lprojfolders and lists the languages inCFBundleLocalizations, so adding a language only touches the catalog. It also adds an emptyen.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.shbuilds English only with a warning, andnotarize-release.shrefuses a release that has no translations.AGENTS.mdgains 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.mdexplains when to split a key and where macOS keeps its translations.I launched the bundle with four language lists.
plandde, plshow Polish,en-GB, planddeshow English, and device names stay as they are. I also checked that the longer Polish approval note and its button fit in Settings.