Repository navigation
Conversation
The #tk and #tkm macros are gone, together with the swift-syntax and swift-macro-testing dependencies. The Lite targets, which already contained everything but the macro, take over the regular names: TranslateKitLite becomes TranslateKit and TranslateKit<Category>Lite becomes TranslateKit<Category>. There are no aliases. The old tests only covered the macro implementation and are replaced by a small Swift Testing suite that loads the core and a category module and resolves strings from their catalogs in two languages. The README drops the macro sections and gains installation steps. A new migration guide explains the move from 1.x, including a prompt that converts macro calls to String(localized:) while keeping the generated catalog keys so existing translations are not lost.
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.
TranslateKit 2.0 removes the
#tk/#tkmmacros and theLitevariants. This PR is meant for the 2.0.0 release.What changes
TranslateKitMacrostarget, the macro-backedTranslateKit/TranslateKit<Category>targets and theirExports.swift/Macros.swiftfiles are removed.Litetargets take over the regular names (product, target, module and folder):TranslateKitLitebecomesTranslateKit,TranslateKit<Category>LitebecomesTranslateKit<Category>. The folders were moved withgit mv, so the 27 String Catalogs show up as renames and other open PRs touching them keep a clean diff.Package.swiftis rewritten with the same platforms,defaultLocalizationand resources.swift-syntax,swift-macro-testingandimport CompilerPluginSupportare gone;Package.resolvedis removed since there are no dependencies left.Litesections and gains installation steps. A newMigrationGuide.mddocuments the upgrade.Why
TK.Action.saveand friends) are the main value of the package; the macro was an add-on with a separate trust story.TranslateKitandTranslateKitLitewas confusing; with the macro gone there is nothing left to distinguish them.Breaking changes
#tkand#tkmno longer exist.*Liteproducts and modules are gone, with no aliases or forwarding targets. Use the same name withoutLite.Migrating from 1.x
Litefrom the product name and from theimport. Nothing else changes.String(localized:defaultValue:comment:), keeping the key the macro generated. WritingString(localized: "Text")instead would change the key and orphan all existing translations in the String Catalog. The prompt below converts the calls and derives or looks up the keys (it is also part ofMigrationGuide.md):How this was verified
swift buildandswift testare green (4 tests, Swift Testing).#tkcalls in 18 files. 225 keys existed in the catalog; the other 7 had no catalog entry before the migration either (the catalog only had plain-text entries such asHaptics), so no translation is lost.#tkcalls in one file, all 6 keys exist in the catalog.var body,var displayName) contribute a component to the key (they do not, only functions and initializers do); keys inside#Previewblocks are machine-generated and must be taken from the catalog; acronym and&handling in the text part. A second run with the fixed prompt produced the same result on both apps.