Repository navigation
Name the case where a catalog key holds a property name - #16
Merged
Merged
Conversation
The guide said properties never contribute to a macro key. The macro did append property names, but most compiler versions never passed the enclosing property to it. A catalog extracted with a toolchain that did holds keys such as BookmarkManager.BookmarkError.UserFriendlyMessage.theURLIsNotAValidFileURL, seen in a real app migration. The guide now names that case and says the catalog key wins.
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.
What changes
MigrationGuide.md, section "The context part": one new bullet after "Properties contribute NOTHING". It names the case where a catalog key does contain the enclosing property name, and states that the catalog key wins.Why
The removed macro (
TranslationKey.semanticKey) did append property names when the compiler listed aVariableDeclSyntaxinlexicalContext. Most toolchains never did, so the "properties contribute nothing" rule held for most catalogs, but not for all. A real migration of the TranslateKit app hit it: the same unchanged source produced two different key sets depending on when the catalog was extracted.Evidence from the app's
Localizable.xcstrings(catalog sync commit, Oct 2026), source unchanged in between – the call sits insidevar userFriendlyMessage: StringofBookmarkManager.BookmarkError:All six error keys in that property moved the same way. A migration that followed the derivation rule alone would have written the old form and orphaned all six translations; following "catalog first" gives the right key. The guide now says so explicitly instead of leaving it to luck.
Alternatives considered
Proof
Docs-only change. Verified against the TranslateKit app: its migrated
BookmarkManager.swiftuses theUserFriendlyMessagekeys verbatim, and all six messages showed as English text, none as raw keys, in a QA run of the app.