From 06ebb9298a1865022b5d3dbd343d0cb2d057253d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20G=C3=BCnd=C3=BCz?= Date: Thu, 8 Oct 2026 11:17:20 +0200 Subject: [PATCH] Remove the #tk macro and drop the Lite variants 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 TranslateKitLite becomes TranslateKit. 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. --- MigrationGuide.md | 93 +++++++ Package.resolved | 51 ---- Package.swift | 243 ++---------------- README.md | 68 ++--- .../Localizable.xcstrings | 0 Sources/TranslateKit/Macros.swift | 146 ----------- .../TK+Action.swift | 0 .../TK+Label.swift | 0 .../TK+Message.swift | 0 .../TK+Placeholder.swift | 0 .../TK.swift | 0 Sources/TranslateKitBooks/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitBusiness/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../TranslateKitDeveloperTools/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitEducation/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../TranslateKitEntertainment/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitFinance/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../TranslateKitFoodAndDrink/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitGames/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitLifestyle/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitMacros/StringExt.swift | 121 --------- .../TranslateKitPlugin.swift | 7 - .../TranslateKitMacros/TranslationKey.swift | 184 ------------- .../TranslationKeyModule.swift | 89 ------- .../Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitMedical/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitMusic/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitNavigation/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitNews/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../TranslateKitPhotoAndVideo/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../TranslateKitProductivity/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitReference/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitShopping/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- .../Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitSports/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitStickers/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitTravel/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitUtilities/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Sources/TranslateKitWeather/Exports.swift | 2 - .../Localizable.xcstrings | 0 .../TK+Action.swift | 2 +- .../TK+Label.swift | 2 +- .../TK+Message.swift | 2 +- .../TK+Placeholder.swift | 2 +- Tests/TranslateKitTests/StringExtTests.swift | 33 --- .../TranslateKitTests/TranslateKitTests.swift | 58 +++++ .../TranslationKeyModuleTests.swift | 120 --------- .../TranslationKeyTests.swift | 95 ------- 175 files changed, 298 insertions(+), 1270 deletions(-) create mode 100644 MigrationGuide.md delete mode 100644 Package.resolved rename Sources/{TranslateKitLite => TranslateKit}/Localizable.xcstrings (100%) delete mode 100644 Sources/TranslateKit/Macros.swift rename Sources/{TranslateKitLite => TranslateKit}/TK+Action.swift (100%) rename Sources/{TranslateKitLite => TranslateKit}/TK+Label.swift (100%) rename Sources/{TranslateKitLite => TranslateKit}/TK+Message.swift (100%) rename Sources/{TranslateKitLite => TranslateKit}/TK+Placeholder.swift (100%) rename Sources/{TranslateKitLite => TranslateKit}/TK.swift (100%) delete mode 100644 Sources/TranslateKitBooks/Exports.swift rename Sources/{TranslateKitBooksLite => TranslateKitBooks}/Localizable.xcstrings (100%) rename Sources/{TranslateKitBooksLite => TranslateKitBooks}/TK+Action.swift (99%) rename Sources/{TranslateKitBooksLite => TranslateKitBooks}/TK+Label.swift (99%) rename Sources/{TranslateKitBooksLite => TranslateKitBooks}/TK+Message.swift (99%) rename Sources/{TranslateKitBooksLite => TranslateKitBooks}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitBusiness/Exports.swift rename Sources/{TranslateKitBusinessLite => TranslateKitBusiness}/Localizable.xcstrings (100%) rename Sources/{TranslateKitBusinessLite => TranslateKitBusiness}/TK+Action.swift (99%) rename Sources/{TranslateKitBusinessLite => TranslateKitBusiness}/TK+Label.swift (99%) rename Sources/{TranslateKitBusinessLite => TranslateKitBusiness}/TK+Message.swift (99%) rename Sources/{TranslateKitBusinessLite => TranslateKitBusiness}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitDeveloperTools/Exports.swift rename Sources/{TranslateKitDeveloperToolsLite => TranslateKitDeveloperTools}/Localizable.xcstrings (100%) rename Sources/{TranslateKitDeveloperToolsLite => TranslateKitDeveloperTools}/TK+Action.swift (99%) rename Sources/{TranslateKitDeveloperToolsLite => TranslateKitDeveloperTools}/TK+Label.swift (99%) rename Sources/{TranslateKitDeveloperToolsLite => TranslateKitDeveloperTools}/TK+Message.swift (99%) rename Sources/{TranslateKitDeveloperToolsLite => TranslateKitDeveloperTools}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitEducation/Exports.swift rename Sources/{TranslateKitEducationLite => TranslateKitEducation}/Localizable.xcstrings (100%) rename Sources/{TranslateKitEducationLite => TranslateKitEducation}/TK+Action.swift (99%) rename Sources/{TranslateKitEducationLite => TranslateKitEducation}/TK+Label.swift (99%) rename Sources/{TranslateKitEducationLite => TranslateKitEducation}/TK+Message.swift (99%) rename Sources/{TranslateKitEducationLite => TranslateKitEducation}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitEntertainment/Exports.swift rename Sources/{TranslateKitEntertainmentLite => TranslateKitEntertainment}/Localizable.xcstrings (100%) rename Sources/{TranslateKitEntertainmentLite => TranslateKitEntertainment}/TK+Action.swift (99%) rename Sources/{TranslateKitEntertainmentLite => TranslateKitEntertainment}/TK+Label.swift (99%) rename Sources/{TranslateKitEntertainmentLite => TranslateKitEntertainment}/TK+Message.swift (99%) rename Sources/{TranslateKitEntertainmentLite => TranslateKitEntertainment}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitFinance/Exports.swift rename Sources/{TranslateKitFinanceLite => TranslateKitFinance}/Localizable.xcstrings (100%) rename Sources/{TranslateKitFinanceLite => TranslateKitFinance}/TK+Action.swift (99%) rename Sources/{TranslateKitFinanceLite => TranslateKitFinance}/TK+Label.swift (99%) rename Sources/{TranslateKitFinanceLite => TranslateKitFinance}/TK+Message.swift (99%) rename Sources/{TranslateKitFinanceLite => TranslateKitFinance}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitFoodAndDrink/Exports.swift rename Sources/{TranslateKitFoodAndDrinkLite => TranslateKitFoodAndDrink}/Localizable.xcstrings (100%) rename Sources/{TranslateKitFoodAndDrinkLite => TranslateKitFoodAndDrink}/TK+Action.swift (99%) rename Sources/{TranslateKitFoodAndDrinkLite => TranslateKitFoodAndDrink}/TK+Label.swift (99%) rename Sources/{TranslateKitFoodAndDrinkLite => TranslateKitFoodAndDrink}/TK+Message.swift (99%) rename Sources/{TranslateKitFoodAndDrinkLite => TranslateKitFoodAndDrink}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitGames/Exports.swift rename Sources/{TranslateKitGamesLite => TranslateKitGames}/Localizable.xcstrings (100%) rename Sources/{TranslateKitGamesLite => TranslateKitGames}/TK+Action.swift (99%) rename Sources/{TranslateKitGamesLite => TranslateKitGames}/TK+Label.swift (99%) rename Sources/{TranslateKitGamesLite => TranslateKitGames}/TK+Message.swift (99%) rename Sources/{TranslateKitGamesLite => TranslateKitGames}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitGraphicsAndDesign/Exports.swift rename Sources/{TranslateKitGraphicsAndDesignLite => TranslateKitGraphicsAndDesign}/Localizable.xcstrings (100%) rename Sources/{TranslateKitGraphicsAndDesignLite => TranslateKitGraphicsAndDesign}/TK+Action.swift (99%) rename Sources/{TranslateKitGraphicsAndDesignLite => TranslateKitGraphicsAndDesign}/TK+Label.swift (99%) rename Sources/{TranslateKitGraphicsAndDesignLite => TranslateKitGraphicsAndDesign}/TK+Message.swift (99%) rename Sources/{TranslateKitGraphicsAndDesignLite => TranslateKitGraphicsAndDesign}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitHealthAndFitness/Exports.swift rename Sources/{TranslateKitHealthAndFitnessLite => TranslateKitHealthAndFitness}/Localizable.xcstrings (100%) rename Sources/{TranslateKitHealthAndFitnessLite => TranslateKitHealthAndFitness}/TK+Action.swift (99%) rename Sources/{TranslateKitHealthAndFitnessLite => TranslateKitHealthAndFitness}/TK+Label.swift (99%) rename Sources/{TranslateKitHealthAndFitnessLite => TranslateKitHealthAndFitness}/TK+Message.swift (99%) rename Sources/{TranslateKitHealthAndFitnessLite => TranslateKitHealthAndFitness}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitLifestyle/Exports.swift rename Sources/{TranslateKitLifestyleLite => TranslateKitLifestyle}/Localizable.xcstrings (100%) rename Sources/{TranslateKitLifestyleLite => TranslateKitLifestyle}/TK+Action.swift (99%) rename Sources/{TranslateKitLifestyleLite => TranslateKitLifestyle}/TK+Label.swift (99%) rename Sources/{TranslateKitLifestyleLite => TranslateKitLifestyle}/TK+Message.swift (99%) rename Sources/{TranslateKitLifestyleLite => TranslateKitLifestyle}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitMacros/StringExt.swift delete mode 100644 Sources/TranslateKitMacros/TranslateKitPlugin.swift delete mode 100644 Sources/TranslateKitMacros/TranslationKey.swift delete mode 100644 Sources/TranslateKitMacros/TranslationKeyModule.swift delete mode 100644 Sources/TranslateKitMagazinesAndNewspapers/Exports.swift rename Sources/{TranslateKitMagazinesAndNewspapersLite => TranslateKitMagazinesAndNewspapers}/Localizable.xcstrings (100%) rename Sources/{TranslateKitMagazinesAndNewspapersLite => TranslateKitMagazinesAndNewspapers}/TK+Action.swift (99%) rename Sources/{TranslateKitMagazinesAndNewspapersLite => TranslateKitMagazinesAndNewspapers}/TK+Label.swift (99%) rename Sources/{TranslateKitMagazinesAndNewspapersLite => TranslateKitMagazinesAndNewspapers}/TK+Message.swift (99%) rename Sources/{TranslateKitMagazinesAndNewspapersLite => TranslateKitMagazinesAndNewspapers}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitMedical/Exports.swift rename Sources/{TranslateKitMedicalLite => TranslateKitMedical}/Localizable.xcstrings (100%) rename Sources/{TranslateKitMedicalLite => TranslateKitMedical}/TK+Action.swift (99%) rename Sources/{TranslateKitMedicalLite => TranslateKitMedical}/TK+Label.swift (99%) rename Sources/{TranslateKitMedicalLite => TranslateKitMedical}/TK+Message.swift (99%) rename Sources/{TranslateKitMedicalLite => TranslateKitMedical}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitMusic/Exports.swift rename Sources/{TranslateKitMusicLite => TranslateKitMusic}/Localizable.xcstrings (100%) rename Sources/{TranslateKitMusicLite => TranslateKitMusic}/TK+Action.swift (99%) rename Sources/{TranslateKitMusicLite => TranslateKitMusic}/TK+Label.swift (99%) rename Sources/{TranslateKitMusicLite => TranslateKitMusic}/TK+Message.swift (99%) rename Sources/{TranslateKitMusicLite => TranslateKitMusic}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitNavigation/Exports.swift rename Sources/{TranslateKitNavigationLite => TranslateKitNavigation}/Localizable.xcstrings (100%) rename Sources/{TranslateKitNavigationLite => TranslateKitNavigation}/TK+Action.swift (99%) rename Sources/{TranslateKitNavigationLite => TranslateKitNavigation}/TK+Label.swift (99%) rename Sources/{TranslateKitNavigationLite => TranslateKitNavigation}/TK+Message.swift (99%) rename Sources/{TranslateKitNavigationLite => TranslateKitNavigation}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitNews/Exports.swift rename Sources/{TranslateKitNewsLite => TranslateKitNews}/Localizable.xcstrings (100%) rename Sources/{TranslateKitNewsLite => TranslateKitNews}/TK+Action.swift (99%) rename Sources/{TranslateKitNewsLite => TranslateKitNews}/TK+Label.swift (99%) rename Sources/{TranslateKitNewsLite => TranslateKitNews}/TK+Message.swift (99%) rename Sources/{TranslateKitNewsLite => TranslateKitNews}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitPhotoAndVideo/Exports.swift rename Sources/{TranslateKitPhotoAndVideoLite => TranslateKitPhotoAndVideo}/Localizable.xcstrings (100%) rename Sources/{TranslateKitPhotoAndVideoLite => TranslateKitPhotoAndVideo}/TK+Action.swift (99%) rename Sources/{TranslateKitPhotoAndVideoLite => TranslateKitPhotoAndVideo}/TK+Label.swift (99%) rename Sources/{TranslateKitPhotoAndVideoLite => TranslateKitPhotoAndVideo}/TK+Message.swift (99%) rename Sources/{TranslateKitPhotoAndVideoLite => TranslateKitPhotoAndVideo}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitProductivity/Exports.swift rename Sources/{TranslateKitProductivityLite => TranslateKitProductivity}/Localizable.xcstrings (100%) rename Sources/{TranslateKitProductivityLite => TranslateKitProductivity}/TK+Action.swift (99%) rename Sources/{TranslateKitProductivityLite => TranslateKitProductivity}/TK+Label.swift (99%) rename Sources/{TranslateKitProductivityLite => TranslateKitProductivity}/TK+Message.swift (99%) rename Sources/{TranslateKitProductivityLite => TranslateKitProductivity}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitReference/Exports.swift rename Sources/{TranslateKitReferenceLite => TranslateKitReference}/Localizable.xcstrings (100%) rename Sources/{TranslateKitReferenceLite => TranslateKitReference}/TK+Action.swift (99%) rename Sources/{TranslateKitReferenceLite => TranslateKitReference}/TK+Label.swift (99%) rename Sources/{TranslateKitReferenceLite => TranslateKitReference}/TK+Message.swift (99%) rename Sources/{TranslateKitReferenceLite => TranslateKitReference}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitShopping/Exports.swift rename Sources/{TranslateKitShoppingLite => TranslateKitShopping}/Localizable.xcstrings (100%) rename Sources/{TranslateKitShoppingLite => TranslateKitShopping}/TK+Action.swift (99%) rename Sources/{TranslateKitShoppingLite => TranslateKitShopping}/TK+Label.swift (99%) rename Sources/{TranslateKitShoppingLite => TranslateKitShopping}/TK+Message.swift (99%) rename Sources/{TranslateKitShoppingLite => TranslateKitShopping}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitSocialNetworking/Exports.swift rename Sources/{TranslateKitSocialNetworkingLite => TranslateKitSocialNetworking}/Localizable.xcstrings (100%) rename Sources/{TranslateKitSocialNetworkingLite => TranslateKitSocialNetworking}/TK+Action.swift (99%) rename Sources/{TranslateKitSocialNetworkingLite => TranslateKitSocialNetworking}/TK+Label.swift (99%) rename Sources/{TranslateKitSocialNetworkingLite => TranslateKitSocialNetworking}/TK+Message.swift (99%) rename Sources/{TranslateKitSocialNetworkingLite => TranslateKitSocialNetworking}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitSports/Exports.swift rename Sources/{TranslateKitSportsLite => TranslateKitSports}/Localizable.xcstrings (100%) rename Sources/{TranslateKitSportsLite => TranslateKitSports}/TK+Action.swift (99%) rename Sources/{TranslateKitSportsLite => TranslateKitSports}/TK+Label.swift (99%) rename Sources/{TranslateKitSportsLite => TranslateKitSports}/TK+Message.swift (99%) rename Sources/{TranslateKitSportsLite => TranslateKitSports}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitStickers/Exports.swift rename Sources/{TranslateKitStickersLite => TranslateKitStickers}/Localizable.xcstrings (100%) rename Sources/{TranslateKitStickersLite => TranslateKitStickers}/TK+Action.swift (99%) rename Sources/{TranslateKitStickersLite => TranslateKitStickers}/TK+Label.swift (99%) rename Sources/{TranslateKitStickersLite => TranslateKitStickers}/TK+Message.swift (99%) rename Sources/{TranslateKitStickersLite => TranslateKitStickers}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitTravel/Exports.swift rename Sources/{TranslateKitTravelLite => TranslateKitTravel}/Localizable.xcstrings (100%) rename Sources/{TranslateKitTravelLite => TranslateKitTravel}/TK+Action.swift (99%) rename Sources/{TranslateKitTravelLite => TranslateKitTravel}/TK+Label.swift (99%) rename Sources/{TranslateKitTravelLite => TranslateKitTravel}/TK+Message.swift (99%) rename Sources/{TranslateKitTravelLite => TranslateKitTravel}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitUtilities/Exports.swift rename Sources/{TranslateKitUtilitiesLite => TranslateKitUtilities}/Localizable.xcstrings (100%) rename Sources/{TranslateKitUtilitiesLite => TranslateKitUtilities}/TK+Action.swift (99%) rename Sources/{TranslateKitUtilitiesLite => TranslateKitUtilities}/TK+Label.swift (99%) rename Sources/{TranslateKitUtilitiesLite => TranslateKitUtilities}/TK+Message.swift (99%) rename Sources/{TranslateKitUtilitiesLite => TranslateKitUtilities}/TK+Placeholder.swift (99%) delete mode 100644 Sources/TranslateKitWeather/Exports.swift rename Sources/{TranslateKitWeatherLite => TranslateKitWeather}/Localizable.xcstrings (100%) rename Sources/{TranslateKitWeatherLite => TranslateKitWeather}/TK+Action.swift (99%) rename Sources/{TranslateKitWeatherLite => TranslateKitWeather}/TK+Label.swift (99%) rename Sources/{TranslateKitWeatherLite => TranslateKitWeather}/TK+Message.swift (99%) rename Sources/{TranslateKitWeatherLite => TranslateKitWeather}/TK+Placeholder.swift (99%) delete mode 100644 Tests/TranslateKitTests/StringExtTests.swift create mode 100644 Tests/TranslateKitTests/TranslateKitTests.swift delete mode 100644 Tests/TranslateKitTests/TranslationKeyModuleTests.swift delete mode 100644 Tests/TranslateKitTests/TranslationKeyTests.swift diff --git a/MigrationGuide.md b/MigrationGuide.md new file mode 100644 index 0000000..17f19fa --- /dev/null +++ b/MigrationGuide.md @@ -0,0 +1,93 @@ +# Migrating from 1.x + +TranslateKit 2.0 removes the `#tk` / `#tkm` macros and the `Lite` variants. The package no longer depends on swift-syntax, so Xcode and CI never ask to "Trust & Enable" a macro, and builds are faster. The pre-localized strings (`TK.Action.save` and friends) work exactly as before. + +## If you used a `Lite` product + +Remove `Lite` from the product name and from the import. Nothing else changes. + +| 1.x | 2.0 | +|---|---| +| `TranslateKitLite` | `TranslateKit` | +| `TranslateKitFinanceLite` | `TranslateKitFinance` | +| `import TranslateKitGamesLite` | `import TranslateKitGames` | + +## If you used `#tk` or `#tkm` + +The macro expanded to a plain `String(localized:defaultValue:comment:)` call with a generated, semantic key (for example `SettingsView.saveChanges`). Replacing it with the expanded call is a mechanical change, but there is one trap: **the key must stay exactly the same**. If you write `String(localized: "Save Changes")` instead, the key becomes `Save Changes`, the existing entry in your String Catalog no longer matches, and all translations of that string are lost. + +```swift +// Before +Button(#tk("Save Changes", c: "Button in the toolbar")) { save() } + +// After – same key as the macro generated +Button(String(localized: "SettingsView.saveChanges", defaultValue: "Save Changes", comment: "Button in the toolbar")) { save() } + +// Before, inside a Swift package (#tkm) +#tkm("Password too short") + +// After +String(localized: "FormValidator.validatePassword.passwordTooShort", defaultValue: "Password too short", bundle: .module) +``` + +Where a pre-localized `TK.*` value with the same meaning exists (for example `TK.Action.save`), prefer it – it ships with translations in about 40 languages and does not add an entry to your catalog. + +Because the key rules are intricate, the easiest and safest way is to let an AI coding assistant do the replacement. Paste the prompt below into the assistant while your project is open (commit or stash your work first, so the result is easy to review): + +````text +You are migrating a Swift project from the TranslateKit 1.x `#tk` / `#tkm` macros to plain `String(localized:defaultValue:comment:)` calls. TranslateKit 2.0 removed the macros. Replace every `#tk(…)` and `#tkm(…)` call in the project. Do not change anything else (no refactoring, no reformatting, no edits to String Catalogs). + +## The one rule that matters + +The macro expanded to a `String(localized:)` call whose KEY is generated from the code context. Existing translations in the project's String Catalog (`Localizable.xcstrings`) are stored under exactly these generated keys. Your replacement MUST use the identical key. If you write `String(localized: "Some Text")` without the key, the key changes and every existing translation of that string is orphaned. Never do that. + +## Replacement + +- `#tk("TEXT")` becomes `String(localized: "KEY", defaultValue: "TEXT")` +- `#tk("TEXT", c: "COMMENT")` becomes `String(localized: "KEY", defaultValue: "TEXT", comment: "COMMENT")` +- `#tkm(…)` is identical, but adds `bundle: .module` after `defaultValue:` (before `comment:`): `String(localized: "KEY", defaultValue: "TEXT", bundle: .module, comment: "COMMENT")` +- Copy TEXT and COMMENT verbatim, including string interpolations such as `\(name)` or `\(ErrorKit.userFriendlyMessage(for: error))`, escape sequences, and the `…` character. Keep the surrounding code (`Text(…)`, `Button(…)`, `.alert(…)`, return statements) untouched – the replacement is a drop-in expression of type `String`. +- Remove `import TranslateKit` only if nothing else in that file uses it (`TK.…` values or other TranslateKit symbols); leave imports of `FlineDevKit` or similar umbrella packages alone. + +## Finding KEY – use the catalog first + +1. Locate the project's String Catalog(s) (`find . -name Localizable.xcstrings -not -path "*/.build/*" -not -path "*/SourcePackages/*"`). For `#tkm` it is the catalog inside the same Swift package target as the file; for `#tk` it is the app's catalog. +2. The KEY always has the form `.`. Take the catalog key whose last dot-separated component matches the text (see "The text part" below) and whose preceding components match the code context (see "The context part"). If exactly one catalog key fits, use it verbatim. Catalog keys are the ground truth; the rules below are only needed to disambiguate or when the catalog has no entry yet (a macro call that was never extracted into the catalog – then use the derived key; it had no translation before either). +3. Do not guess a key that merely looks similar. If two catalog keys are plausible, work out the derivation below exactly and choose the one it yields. + +### The context part + +Walk from the OUTERMOST enclosing declaration to the innermost one around the macro call and join the names with `.`: +- `struct`, `class` and `enum` declarations contribute their name; `extension` contributes the extended type (`extension TK.Label` contributes `TK.Label` i.e. two components `TK`, `Label`; `extension Foo.Bar` contributes `Foo`, `Bar`). `actor`, `protocol`, closures, accessors (`get`/`set`/`didSet`), subscripts and enum cases contribute NOTHING. +- A function (`func fetchData(…)`) contributes its base name only (no parameters). An initializer contributes the literal `init`. +- Properties contribute NOTHING, stored or computed, and neither does `var body`: a call inside `var body` or `var displayName` gets only the type names before it (`struct SettingsView { var body … #tk("Save Changes") }` → `SettingsView.saveChanges`, `enum Category { var displayName … #tk("Anime") }` → `Category.anime`). Only functions and initializers add a component. +- Every contributed name is converted to UpperCamelCase: first letter uppercased, other letters unchanged (`fetchData` → `FetchData`, `RESTClient` stays `RESTClient`); non-alphanumeric characters (including apostrophes) are removed and the following letter is uppercased; diacritics are removed. +- Inside the body of a `#Preview { … }` (or any other macro that wraps the code) the context is a long machine-generated name such as `S3App0025BoardFieldViewswift…Ll7PreviewfMf15…`. This cannot be derived by hand – take such a key verbatim from the catalog by matching its last component, and leave the call unchanged if the catalog has no match. +- Nested types appear in order, e.g. `struct Outer { struct Inner { func render() { … } } }` → `Outer.Inner.Render`. Closures and `Text(…)`/`Button(…)` nesting do not add components. + +### The text part + +Take the string literal EXACTLY as written in source (interpolations stay as the raw source characters `\(expr)`; quotes are stripped from both ends): +- If it ends with `…`: remove the `…`, lowerCamelCase the rest, append `Dots`. Example: `"Add Item…"` → `addItemDots`. +- Else if it has more than 3 characters and is entirely uppercase (`text.uppercased() == text`): use it unchanged (`"OK"` has 2 characters, so it is camel-cased → `ok`; `"DONE"` stays `DONE`). +- Otherwise lowerCamelCase: split the text into words at every character that is not a letter or digit (punctuation and spaces disappear; apostrophes/quotation marks are removed without splitting the word: `it's` → `its`), keep the letters of each word as they are except that each word starts uppercase, lowercase only the very first letter of the first word, then join. Additionally a new word starts at every lower-to-upper letter transition and at every letter-to-digit or digit-to-letter transition, and an acronym followed by a capitalised word splits before the last capital (`TVShow` → `tvShow`). Only the first 10 words are used; if there are more, append `…` to the key. Characters with diacritics are folded to their base letter. Interpolations contribute their characters as words: `"Hello \(name)!"` → `helloName`. +- A leading acronym is lowercased as a whole (`"TV Shows"` → `tvShows`, `"CSV"` → `csv`), and periods between single letters are dropped without splitting (`"e.g. Mom's Birthday"` → `egMomsBirthday`). A lone `&` is dropped (`"Culture & Religion"` → `cultureReligion`). +- Examples: `"Save Changes"` → `saveChanges`; `"The URL is not a valid file URL"` → `theURLIsNotAValidFileURL`; `"TV Show"` → `tvShow`; `"What's your name?"` → `whatsYourName`. + +## Prefer pre-localized TK values where they exist + +If the project imports TranslateKit (or an umbrella that re-exports it) and the text is a plain, context-free string that is exactly (or near-exactly, same meaning) available as a `TK.Action`, `TK.Label`, `TK.Placeholder` or `TK.Message` property (for example "Save" → `TK.Action.save`, "Cancel" → `TK.Action.cancel`), you may use that property instead – but only when it is a pure UI string without interpolation, and only after checking the property exists (search the TranslateKit sources in the package checkout, e.g. `.build/checkouts/TranslateKit/Sources` or the SwiftPM checkouts folder of Xcode's DerivedData, or its autocompletion documentation comments `/// "Save" - …`). When unsure, keep the `String(localized:)` form with the preserved key; a preserved key is always correct. Note: switching to `TK.*` leaves the old catalog entry unused; mention each such case in your final report so the owner can clean the catalog later. + +## Verify + +1. `grep -rn '#tkm\?(' --include='*.swift' .` must return nothing. +2. For every `String(localized: "KEY"` you wrote, confirm KEY exists in the relevant catalog: if not, list it in your report as "new key (no existing translation)" and double-check your derivation, since a missing key usually means a derivation mistake. +3. Make sure the project builds. + +Final report: the number of replacements, every key that was NOT found in the catalog, and every case where you used a `TK.*` value. +```` + +## Notes + +- Swift Package users: `#tkm` needs `bundle: .module`, which requires `defaultLocalization` and a `Localizable.xcstrings` in the target – exactly as before. +- Xcode extracts `String(localized:)` calls into the catalog automatically, so no further catalog changes are needed after the migration. diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 1666dad..0000000 --- a/Package.resolved +++ /dev/null @@ -1,51 +0,0 @@ -{ - "originHash" : "aed76f9e054b40dfcd98cf6706c5a538bc1b1354c0f5363a05392c56964c489e", - "pins" : [ - { - "identity" : "swift-custom-dump", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-custom-dump", - "state" : { - "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1", - "version" : "1.3.3" - } - }, - { - "identity" : "swift-macro-testing", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-macro-testing.git", - "state" : { - "branch" : "main", - "revision" : "415964c6f83e21aadc2bb5ad73caba1f6551553d" - } - }, - { - "identity" : "swift-snapshot-testing", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-snapshot-testing", - "state" : { - "revision" : "f5bfff796ee8e3bc9a685b7ffba1bf20663eb370", - "version" : "1.18.0" - } - }, - { - "identity" : "swift-syntax", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", - "state" : { - "revision" : "0687f71944021d616d34d922343dcef086855920", - "version" : "600.0.1" - } - }, - { - "identity" : "xctest-dynamic-overlay", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", - "state" : { - "revision" : "39de59b2d47f7ef3ca88a039dff3084688fe27f4", - "version" : "1.5.2" - } - } - ], - "version" : 3 -} diff --git a/Package.swift b/Package.swift index ce46ed8..22400ca 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,3 @@ -import CompilerPluginSupport // swift-tools-version: 6.0 import PackageDescription @@ -7,7 +6,6 @@ let package = Package( defaultLocalization: "en", platforms: [.macOS(.v13), .iOS(.v16), .tvOS(.v16), .watchOS(.v9), .macCatalyst(.v16)], products: [ - // With Macro support .library(name: "TranslateKit", targets: ["TranslateKit"]), .library(name: "TranslateKitBooks", targets: ["TranslateKitBooks"]), .library(name: "TranslateKitBusiness", targets: ["TranslateKitBusiness"]), @@ -35,332 +33,145 @@ let package = Package( .library(name: "TranslateKitTravel", targets: ["TranslateKitTravel"]), .library(name: "TranslateKitUtilities", targets: ["TranslateKitUtilities"]), .library(name: "TranslateKitWeather", targets: ["TranslateKitWeather"]), - - // Without Macro support - .library(name: "TranslateKitLite", targets: ["TranslateKitLite"]), - .library(name: "TranslateKitBooksLite", targets: ["TranslateKitBooksLite"]), - .library(name: "TranslateKitBusinessLite", targets: ["TranslateKitBusinessLite"]), - .library(name: "TranslateKitDeveloperToolsLite", targets: ["TranslateKitDeveloperToolsLite"]), - .library(name: "TranslateKitEducationLite", targets: ["TranslateKitEducationLite"]), - .library(name: "TranslateKitEntertainmentLite", targets: ["TranslateKitEntertainmentLite"]), - .library(name: "TranslateKitFinanceLite", targets: ["TranslateKitFinanceLite"]), - .library(name: "TranslateKitFoodAndDrinkLite", targets: ["TranslateKitFoodAndDrinkLite"]), - .library(name: "TranslateKitGamesLite", targets: ["TranslateKitGamesLite"]), - .library(name: "TranslateKitGraphicsAndDesignLite", targets: ["TranslateKitGraphicsAndDesignLite"]), - .library(name: "TranslateKitHealthAndFitnessLite", targets: ["TranslateKitHealthAndFitnessLite"]), - .library(name: "TranslateKitLifestyleLite", targets: ["TranslateKitLifestyleLite"]), - .library(name: "TranslateKitMagazinesAndNewspapersLite", targets: ["TranslateKitMagazinesAndNewspapersLite"]), - .library(name: "TranslateKitMedicalLite", targets: ["TranslateKitMedicalLite"]), - .library(name: "TranslateKitMusicLite", targets: ["TranslateKitMusicLite"]), - .library(name: "TranslateKitNavigationLite", targets: ["TranslateKitNavigationLite"]), - .library(name: "TranslateKitNewsLite", targets: ["TranslateKitNewsLite"]), - .library(name: "TranslateKitPhotoAndVideoLite", targets: ["TranslateKitPhotoAndVideoLite"]), - .library(name: "TranslateKitProductivityLite", targets: ["TranslateKitProductivityLite"]), - .library(name: "TranslateKitReferenceLite", targets: ["TranslateKitReferenceLite"]), - .library(name: "TranslateKitShoppingLite", targets: ["TranslateKitShoppingLite"]), - .library(name: "TranslateKitSocialNetworkingLite", targets: ["TranslateKitSocialNetworkingLite"]), - .library(name: "TranslateKitSportsLite", targets: ["TranslateKitSportsLite"]), - .library(name: "TranslateKitStickersLite", targets: ["TranslateKitStickersLite"]), - .library(name: "TranslateKitTravelLite", targets: ["TranslateKitTravelLite"]), - .library(name: "TranslateKitUtilitiesLite", targets: ["TranslateKitUtilitiesLite"]), - .library(name: "TranslateKitWeatherLite", targets: ["TranslateKitWeatherLite"]), - ], - dependencies: [ - // being a good citizen: https://www.pointfree.co/blog/posts/116-being-a-good-citizen-in-the-land-of-swiftsyntax - .package(url: "https://github.com/apple/swift-syntax.git", "600.0.0"..<"699.99.99"), - .package(url: "https://github.com/pointfreeco/swift-macro-testing.git", branch: "main"), ], targets: [ - // Core Targets - .target( - name: "TranslateKitLite", - dependencies: [], - resources: [.process("Localizable.xcstrings")] - ), .target( name: "TranslateKit", - dependencies: ["TranslateKitLite", "TranslateKitMacros"], - resources: [] - ), - - // Category-specific Lite Targets (without macros) - .target( - name: "TranslateKitBooksLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitBusinessLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitDeveloperToolsLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitEducationLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitEntertainmentLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitFinanceLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitFoodAndDrinkLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitGamesLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitGraphicsAndDesignLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitHealthAndFitnessLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitLifestyleLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitMagazinesAndNewspapersLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitMedicalLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitMusicLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitNavigationLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitNewsLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitPhotoAndVideoLite", - dependencies: ["TranslateKitLite"], resources: [.process("Localizable.xcstrings")] ), - .target( - name: "TranslateKitProductivityLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitReferenceLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitShoppingLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitSocialNetworkingLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitSportsLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitStickersLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitTravelLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitUtilitiesLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - .target( - name: "TranslateKitWeatherLite", - dependencies: ["TranslateKitLite"], - resources: [.process("Localizable.xcstrings")] - ), - - // Category-specific Targets with macros (current behavior) .target( name: "TranslateKitBooks", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitBusiness", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitDeveloperTools", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitEducation", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitEntertainment", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitFinance", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitFoodAndDrink", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitGames", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitGraphicsAndDesign", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitHealthAndFitness", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitLifestyle", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitMagazinesAndNewspapers", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitMedical", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitMusic", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitNavigation", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitNews", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitPhotoAndVideo", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitProductivity", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitReference", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitShopping", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitSocialNetworking", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitSports", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitStickers", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitTravel", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitUtilities", dependencies: ["TranslateKit"], - resources: [] + resources: [.process("Localizable.xcstrings")] ), .target( name: "TranslateKitWeather", dependencies: ["TranslateKit"], - resources: [] - ), - - // Support Targets - .macro( - name: "TranslateKitMacros", - dependencies: [ - .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), - .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), - ] + resources: [.process("Localizable.xcstrings")] ), .testTarget( name: "TranslateKitTests", - dependencies: [ - "TranslateKit", - .product(name: "MacroTesting", package: "swift-macro-testing"), - ] + dependencies: ["TranslateKit", "TranslateKitFinance"] ), ] ) diff --git a/README.md b/README.md index 5d366ce..aac4cc9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ What SF Symbols is for Icons, TranslateKit is for Text! -Eliminate localization overhead in your Swift apps with 2000+ pre-localized strings and semantic key generation. Make app localization simple, accurate, and delightful. +Eliminate localization overhead in your Swift apps with 2000+ pre-localized strings. Make app localization simple, accurate, and delightful. ## Key Features @@ -34,36 +34,12 @@ Discovering the right translations is effortless with autocompletion – type `T ![Showcasing Autocompletion in Xcode](https://github.com/FlineDev/TranslateKit/blob/main/Images/Autocomplete.jpeg?raw=true) -### 2. Smart Key Generation -The `#tk` macro eliminates the tedious work of manual key management by automatically generating semantic keys based on code context: - -```swift -struct SettingsView: View { - let documentName: String - - var body: some View { - // Generates key: SettingsView.Body.saveChanges - Button(#tk("Save Changes")) { handleSave() } - - // Add context with 'c' parameter to help translators - Text(#tk("Save changes to \(documentName)?", - c: "e.g. 'Save changes to MyNumbers.csv'")) - } -} -``` - -String Catalogs made it challenging to maintain best practices from the Strings-file era, where using semantic keys helped group related translations. The macro brings back this advantage while keeping String Catalogs' benefits - you get semantic keys without writing verbose `String(localized:defaultValue:comment:)` calls: - -![Macro Expansion in Xcode](https://github.com/FlineDev/TranslateKit/blob/main/Images/MacroExpansion.jpeg?raw=true) - -You can see in the image what the simple `#tk` macro call expands to, adding an auto-derived key. These semantic keys help group related translations and provide crucial context to translators and translation tools (like the [TranslateKit Mac app](https://translatekit.app)), leading to more accurate translations while making your localization files easier to maintain. - ### Core Strings & Category-Specific Extensions To keep TranslateKit lightweight while providing comprehensive coverage, the 2,000+ pre-localized strings are organized into two tiers: 1. **Core Strings (250+):** - Included in the base `TranslateKit` package, these strings are commonly used across all kinds of apps, making them universally applicable. + Included in the base `TranslateKit` product, these strings are commonly used across all kinds of apps, making them universally applicable. 2. **Category-Specific Extensions (~100 per category):** Each of the **26 App Store categories** has an additional module with strings tailored to that category. For example: @@ -75,44 +51,32 @@ To keep TranslateKit lightweight while providing comprehensive coverage, the 2,0 With this modular approach, TranslateKit remains lightweight, adding only ~1MB to your app, making it suitable for any project – big or small. -## Swift Package Usage +## Installation -For Swift packages, use `#tkm` instead of `#tk` to reference the correct String Catalog file: +Add the package with Swift Package Manager: -1. Add `defaultLocalization` to your manifest: ```swift -let package = Package( - name: "FormKit", - defaultLocalization: "en", - // ... -) +.package(url: "https://github.com/FlineDev/TranslateKitSDK.git", from: "2.0.0") ``` -2. Add `Localizable.xcstrings` to your module (right-click folder > "New File from Template…" > String Catalog) +Then add the product that fits your app – the core `TranslateKit` or one of the category modules, which already include the core strings: -3. Use the `#tkm` macro with optional comment: ```swift -struct FormValidator { - static func validatePassword(_ password: String) -> String? { - guard password.count >= 8 else { - return #tkm("Password must be at least 8 characters") - } - return nil - } -} +.target( + name: "MyApp", + dependencies: [ + .product(name: "TranslateKitFinance", package: "TranslateKitSDK") // or "TranslateKit" for the core strings only + ] +) ``` -Common reasons to localize Swift packages are that they may contain UI elements (e.g. modularized apps) or that they might provide error descriptions, which should be localized in most cases. - -## Solving Macro Trust Issues in Xcode Cloud - -If you're using Xcode Cloud or experiencing issues with macro trust, check out our guide [Solving Swift Macro Trust Issues in Xcode Cloud Builds](https://www.fline.dev/solving-swift-macro-trust-issues-in-xcode-cloud-builds/). This article explains how to properly configure your build settings when CI systems don't automatically trust macro packages. +In Xcode, use *File > Add Package Dependencies…* and pick the same product. Then `import TranslateKit` (or e.g. `import TranslateKitFinance`) and use the static properties, e.g. `TK.Action.save`. -## Using TranslateKit without Macros +The package has no dependencies and no macros, so Xcode and CI never ask you to trust anything. -If you don't want to use the `tk` macro but still profit from the community-driven common strings in your app, you can also opt for one of the `Lite` targets instead of the regular ones. For example, instead of adding and importing the `TranslateKit` target to your app, you can instead add & import `TranslateKitLite`. For category-specific variants, instead of something like `TranslateKitGames`, use `TranslateKitGamesLite`. +## Migrating from 1.x -The `Lite` variants of the targets ensure that Xcode (and CI workflows) won't ask you to "Trust & Enable" macros in TranslateKit. But they also lack the added context you get when using `#tk` macro. We include these macros by default because we recommend everyone using them, but the `Lite` targets give you a way to opt-out when needed. +Version 2.0 removed the `#tk` / `#tkm` macros and the `Lite` variants (`TranslateKitLite` is now simply `TranslateKit`). See the [migration guide](MigrationGuide.md) – it includes a prompt that lets an AI assistant convert your macro calls without losing existing translations. ## Contributing diff --git a/Sources/TranslateKitLite/Localizable.xcstrings b/Sources/TranslateKit/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitLite/Localizable.xcstrings rename to Sources/TranslateKit/Localizable.xcstrings diff --git a/Sources/TranslateKit/Macros.swift b/Sources/TranslateKit/Macros.swift deleted file mode 100644 index 3e4a5eb..0000000 --- a/Sources/TranslateKit/Macros.swift +++ /dev/null @@ -1,146 +0,0 @@ -import Foundation -@_exported import TranslateKitLite - -/// A localization macro that dynamically generates translation keys based on the code context. -/// -/// The `#tk(_:)` macro automatically constructs a meaningful translation key derived from the surrounding context, -/// such as the type, property, or method in which the text is used. This allows for precise and intuitive keys -/// without manually specifying them, improving translation quality and consistency. -/// -/// ### Example Usage: -/// #### View Example -/// ```swift -/// struct MyView: View { -/// var body: some View { -/// Button(#tk("Save Changes")) { -/// self.handleSave() -/// } -/// } -/// } -/// ``` -/// In this example, `#tk("Save Changes")` generates the translation key: -/// `MyView.Body.saveChanges`. -/// -/// The expanded code would be: -/// ```swift -/// String(localized: "MyView.Body.saveChanges", defaultValue: "Save Changes") -/// ``` -/// -/// #### Comment Support -/// ```swift -/// struct ProfileView { -/// func formatLastSeen(date: Date) -> String { -/// #tk("Last seen %@", c: "Time when user was last active, e.g. 'Last seen yesterday at 2:30 PM'") -/// } -/// -/// func formatFollowers(count: Int) -> String { -/// #tk("%lld followers", c: "Number of followers, e.g. '1,234 followers'") -/// } -/// } -/// ``` -/// -/// ### Generated Keys -/// The macro automatically generates semantic keys based on their context in the code: -/// - Type names (structs, classes, enums) -/// - Property names -/// - Function names -/// - Namespace information -/// -/// ### Benefits: -/// - Automatically generated translation keys provide better context for translators -/// - Eliminates the need for additional comments in most cases -/// - Ensures consistent key naming based on the structural context of the code -/// -/// For SwiftPM module-specific translations, use the ``#tkm(_:c:)`` macro instead. -/// -/// - Parameter defaultValue: The text to be localized provided in the source language. -/// - Parameter comment: Optional context for translators, particularly useful for strings with dynamic content. -/// - Returns: A localized string using a dynamically constructed key. -@freestanding(expression) -public macro tk( - _ defaultValue: String, - c comment: StaticString? = nil -) -> String = #externalMacro(module: "TranslateKitMacros", type: "TranslationKey") - -/// A module-specific localization macro that generates translation keys for the current module's resources. -/// -/// The `#tkm(_:)` macro works identically to ``#tk(_:)`` but uses the current module's bundle -/// for resource lookup. This is particularly useful when working with packages, frameworks, or any code -/// where translations are bundled with the Swift package itself. -/// -/// ### Example Usage: -/// #### View Example -/// ```swift -/// struct MyView: View { -/// var body: some View { -/// Button(#tkm("Save Changes")) { -/// self.handleSave() -/// } -/// } -/// } -/// ``` -/// In this example, `#tkm("Save Changes")` generates the translation key: -/// `MyView.Body.saveChanges`. -/// -/// The expanded code would be: -/// ```swift -/// String(localized: "MyView.Body.saveChanges", defaultValue: "Save Changes", bundle: .module) -/// ``` -/// -/// #### Comment Support -/// ```swift -/// struct ProfileView { -/// func formatLastSeen(date: Date) -> String { -/// #tkm("Last seen %@", c: "Time when user was last active, e.g. 'Last seen yesterday at 2:30 PM'") -/// } -/// -/// func formatFollowers(count: Int) -> String { -/// #tkm("%lld followers", c: "Number of followers, e.g. '1,234 followers'") -/// } -/// } -/// ``` -/// -/// ### Generated Keys -/// The macro automatically generates semantic keys based on their context in the code: -/// - Type names (structs, classes, enums) -/// - Property names -/// - Function names -/// - Namespace information -/// -/// ### Benefits: -/// - Automatically generated translation keys provide better context for translators -/// - Eliminates the need for additional comments in most cases -/// - Ensures consistent key naming based on the structural context of the code -/// -/// ### Requirements -/// To use this macro in a Swift package: -/// 1. Add the `defaultLocalization` parameter to your package manifest: -/// ```swift -/// .target( -/// name: "MyModule", -/// defaultLocalization: "en", -/// // ... -/// ) -/// ``` -/// 2. Add a String Catalog named `Localizable.xcstrings` to your module -/// -/// Without these requirements, the expanded code won't compile as `.module` is only -/// available when there's at least one resource in the module. -/// -/// ### When to Use -/// Use `#tkm(_:)` when: -/// - Your translations are bundled with your module/package -/// - You're developing a reusable component or library -/// - You want to keep translations scoped to your module -/// - You're working with SPM packages or frameworks -/// -/// For translations in the main app bundle, use ``#tk(_:c:)`` instead. -/// -/// - Parameter defaultValue: The text to be localized provided in the source language. -/// - Parameter comment: Optional context for translators, particularly useful for strings with dynamic content. -/// - Returns: A localized string using a dynamically constructed key and the current module's bundle. -@freestanding(expression) -public macro tkm( - _ defaultValue: String, - c comment: StaticString? = nil -) -> String = #externalMacro(module: "TranslateKitMacros", type: "TranslationKeyModule") diff --git a/Sources/TranslateKitLite/TK+Action.swift b/Sources/TranslateKit/TK+Action.swift similarity index 100% rename from Sources/TranslateKitLite/TK+Action.swift rename to Sources/TranslateKit/TK+Action.swift diff --git a/Sources/TranslateKitLite/TK+Label.swift b/Sources/TranslateKit/TK+Label.swift similarity index 100% rename from Sources/TranslateKitLite/TK+Label.swift rename to Sources/TranslateKit/TK+Label.swift diff --git a/Sources/TranslateKitLite/TK+Message.swift b/Sources/TranslateKit/TK+Message.swift similarity index 100% rename from Sources/TranslateKitLite/TK+Message.swift rename to Sources/TranslateKit/TK+Message.swift diff --git a/Sources/TranslateKitLite/TK+Placeholder.swift b/Sources/TranslateKit/TK+Placeholder.swift similarity index 100% rename from Sources/TranslateKitLite/TK+Placeholder.swift rename to Sources/TranslateKit/TK+Placeholder.swift diff --git a/Sources/TranslateKitLite/TK.swift b/Sources/TranslateKit/TK.swift similarity index 100% rename from Sources/TranslateKitLite/TK.swift rename to Sources/TranslateKit/TK.swift diff --git a/Sources/TranslateKitBooks/Exports.swift b/Sources/TranslateKitBooks/Exports.swift deleted file mode 100644 index 4900cb3..0000000 --- a/Sources/TranslateKitBooks/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitBooksLite diff --git a/Sources/TranslateKitBooksLite/Localizable.xcstrings b/Sources/TranslateKitBooks/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitBooksLite/Localizable.xcstrings rename to Sources/TranslateKitBooks/Localizable.xcstrings diff --git a/Sources/TranslateKitBooksLite/TK+Action.swift b/Sources/TranslateKitBooks/TK+Action.swift similarity index 99% rename from Sources/TranslateKitBooksLite/TK+Action.swift rename to Sources/TranslateKitBooks/TK+Action.swift index 86219cb..e726a17 100644 --- a/Sources/TranslateKitBooksLite/TK+Action.swift +++ b/Sources/TranslateKitBooks/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Add Bookmark" - Use when marking a specific page or position in a book diff --git a/Sources/TranslateKitBooksLite/TK+Label.swift b/Sources/TranslateKitBooks/TK+Label.swift similarity index 99% rename from Sources/TranslateKitBooksLite/TK+Label.swift rename to Sources/TranslateKitBooks/TK+Label.swift index 05e7c13..aa46ef1 100644 --- a/Sources/TranslateKitBooksLite/TK+Label.swift +++ b/Sources/TranslateKitBooks/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Annotations" - Use when referring to the user's notes or highlights in a book diff --git a/Sources/TranslateKitBooksLite/TK+Message.swift b/Sources/TranslateKitBooks/TK+Message.swift similarity index 99% rename from Sources/TranslateKitBooksLite/TK+Message.swift rename to Sources/TranslateKitBooks/TK+Message.swift index 1f723f7..47ea933 100644 --- a/Sources/TranslateKitBooksLite/TK+Message.swift +++ b/Sources/TranslateKitBooks/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Annotation saved successfully." - Confirmation when a user saves an annotation diff --git a/Sources/TranslateKitBooksLite/TK+Placeholder.swift b/Sources/TranslateKitBooks/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitBooksLite/TK+Placeholder.swift rename to Sources/TranslateKitBooks/TK+Placeholder.swift index 87d08ae..83c80e3 100644 --- a/Sources/TranslateKitBooksLite/TK+Placeholder.swift +++ b/Sources/TranslateKitBooks/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a bookmark…" - Placeholder for adding a bookmark diff --git a/Sources/TranslateKitBusiness/Exports.swift b/Sources/TranslateKitBusiness/Exports.swift deleted file mode 100644 index 1de3e37..0000000 --- a/Sources/TranslateKitBusiness/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitBusinessLite diff --git a/Sources/TranslateKitBusinessLite/Localizable.xcstrings b/Sources/TranslateKitBusiness/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitBusinessLite/Localizable.xcstrings rename to Sources/TranslateKitBusiness/Localizable.xcstrings diff --git a/Sources/TranslateKitBusinessLite/TK+Action.swift b/Sources/TranslateKitBusiness/TK+Action.swift similarity index 99% rename from Sources/TranslateKitBusinessLite/TK+Action.swift rename to Sources/TranslateKitBusiness/TK+Action.swift index 99959a0..edfc7e7 100644 --- a/Sources/TranslateKitBusinessLite/TK+Action.swift +++ b/Sources/TranslateKitBusiness/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Approve" - Use when authorizing or approving a task, request, or process diff --git a/Sources/TranslateKitBusinessLite/TK+Label.swift b/Sources/TranslateKitBusiness/TK+Label.swift similarity index 99% rename from Sources/TranslateKitBusinessLite/TK+Label.swift rename to Sources/TranslateKitBusiness/TK+Label.swift index 5e10caf..5b2009d 100644 --- a/Sources/TranslateKitBusinessLite/TK+Label.swift +++ b/Sources/TranslateKitBusiness/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Address" - Use for address fields or location information diff --git a/Sources/TranslateKitBusinessLite/TK+Message.swift b/Sources/TranslateKitBusiness/TK+Message.swift similarity index 99% rename from Sources/TranslateKitBusinessLite/TK+Message.swift rename to Sources/TranslateKitBusiness/TK+Message.swift index 7a5c7ef..e1d68da 100644 --- a/Sources/TranslateKitBusinessLite/TK+Message.swift +++ b/Sources/TranslateKitBusiness/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Account balance is overdue." - Notification for overdue account payments diff --git a/Sources/TranslateKitBusinessLite/TK+Placeholder.swift b/Sources/TranslateKitBusiness/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitBusinessLite/TK+Placeholder.swift rename to Sources/TranslateKitBusiness/TK+Placeholder.swift index ed98109..65c5e74 100644 --- a/Sources/TranslateKitBusinessLite/TK+Placeholder.swift +++ b/Sources/TranslateKitBusiness/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add client details…" - Placeholder for entering client-related information diff --git a/Sources/TranslateKitDeveloperTools/Exports.swift b/Sources/TranslateKitDeveloperTools/Exports.swift deleted file mode 100644 index 396e610..0000000 --- a/Sources/TranslateKitDeveloperTools/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitDeveloperToolsLite diff --git a/Sources/TranslateKitDeveloperToolsLite/Localizable.xcstrings b/Sources/TranslateKitDeveloperTools/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitDeveloperToolsLite/Localizable.xcstrings rename to Sources/TranslateKitDeveloperTools/Localizable.xcstrings diff --git a/Sources/TranslateKitDeveloperToolsLite/TK+Action.swift b/Sources/TranslateKitDeveloperTools/TK+Action.swift similarity index 99% rename from Sources/TranslateKitDeveloperToolsLite/TK+Action.swift rename to Sources/TranslateKitDeveloperTools/TK+Action.swift index 9dd374b..84ad3f6 100644 --- a/Sources/TranslateKitDeveloperToolsLite/TK+Action.swift +++ b/Sources/TranslateKitDeveloperTools/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Analyze" - Use when performing analysis on a project or dataset diff --git a/Sources/TranslateKitDeveloperToolsLite/TK+Label.swift b/Sources/TranslateKitDeveloperTools/TK+Label.swift similarity index 99% rename from Sources/TranslateKitDeveloperToolsLite/TK+Label.swift rename to Sources/TranslateKitDeveloperTools/TK+Label.swift index b424973..9193cbe 100644 --- a/Sources/TranslateKitDeveloperToolsLite/TK+Label.swift +++ b/Sources/TranslateKitDeveloperTools/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "API" - Use when referring to the Application Programming Interface diff --git a/Sources/TranslateKitDeveloperToolsLite/TK+Message.swift b/Sources/TranslateKitDeveloperTools/TK+Message.swift similarity index 99% rename from Sources/TranslateKitDeveloperToolsLite/TK+Message.swift rename to Sources/TranslateKitDeveloperTools/TK+Message.swift index 42bacd7..54e88ec 100644 --- a/Sources/TranslateKitDeveloperToolsLite/TK+Message.swift +++ b/Sources/TranslateKitDeveloperTools/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Access Denied" - Use when a user is not authorized to access a resource diff --git a/Sources/TranslateKitDeveloperToolsLite/TK+Placeholder.swift b/Sources/TranslateKitDeveloperTools/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitDeveloperToolsLite/TK+Placeholder.swift rename to Sources/TranslateKitDeveloperTools/TK+Placeholder.swift index 8d5a771..ceeae93 100644 --- a/Sources/TranslateKitDeveloperToolsLite/TK+Placeholder.swift +++ b/Sources/TranslateKitDeveloperTools/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a description…" - Placeholder for entering a description of an item or feature diff --git a/Sources/TranslateKitEducation/Exports.swift b/Sources/TranslateKitEducation/Exports.swift deleted file mode 100644 index f380b40..0000000 --- a/Sources/TranslateKitEducation/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitEducationLite diff --git a/Sources/TranslateKitEducationLite/Localizable.xcstrings b/Sources/TranslateKitEducation/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitEducationLite/Localizable.xcstrings rename to Sources/TranslateKitEducation/Localizable.xcstrings diff --git a/Sources/TranslateKitEducationLite/TK+Action.swift b/Sources/TranslateKitEducation/TK+Action.swift similarity index 99% rename from Sources/TranslateKitEducationLite/TK+Action.swift rename to Sources/TranslateKitEducation/TK+Action.swift index 4820d55..534862e 100644 --- a/Sources/TranslateKitEducationLite/TK+Action.swift +++ b/Sources/TranslateKitEducation/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Practice" - Use for engaging in learning exercises diff --git a/Sources/TranslateKitEducationLite/TK+Label.swift b/Sources/TranslateKitEducation/TK+Label.swift similarity index 99% rename from Sources/TranslateKitEducationLite/TK+Label.swift rename to Sources/TranslateKitEducation/TK+Label.swift index e5a4470..7dec87b 100644 --- a/Sources/TranslateKitEducationLite/TK+Label.swift +++ b/Sources/TranslateKitEducation/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Chapter" - Use for dividing content into distinct sections diff --git a/Sources/TranslateKitEducationLite/TK+Message.swift b/Sources/TranslateKitEducation/TK+Message.swift similarity index 99% rename from Sources/TranslateKitEducationLite/TK+Message.swift rename to Sources/TranslateKitEducation/TK+Message.swift index c315341..0a79016 100644 --- a/Sources/TranslateKitEducationLite/TK+Message.swift +++ b/Sources/TranslateKitEducation/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Great job!" - Use for praising a user's achievement diff --git a/Sources/TranslateKitEducationLite/TK+Placeholder.swift b/Sources/TranslateKitEducation/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitEducationLite/TK+Placeholder.swift rename to Sources/TranslateKitEducation/TK+Placeholder.swift index 1978919..cb86101 100644 --- a/Sources/TranslateKitEducationLite/TK+Placeholder.swift +++ b/Sources/TranslateKitEducation/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Enter answer…" - Placeholder for answer input fields diff --git a/Sources/TranslateKitEntertainment/Exports.swift b/Sources/TranslateKitEntertainment/Exports.swift deleted file mode 100644 index 2fdc118..0000000 --- a/Sources/TranslateKitEntertainment/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitEntertainmentLite diff --git a/Sources/TranslateKitEntertainmentLite/Localizable.xcstrings b/Sources/TranslateKitEntertainment/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitEntertainmentLite/Localizable.xcstrings rename to Sources/TranslateKitEntertainment/Localizable.xcstrings diff --git a/Sources/TranslateKitEntertainmentLite/TK+Action.swift b/Sources/TranslateKitEntertainment/TK+Action.swift similarity index 99% rename from Sources/TranslateKitEntertainmentLite/TK+Action.swift rename to Sources/TranslateKitEntertainment/TK+Action.swift index 2d169bd..0b4f30a 100644 --- a/Sources/TranslateKitEntertainmentLite/TK+Action.swift +++ b/Sources/TranslateKitEntertainment/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Add to Playlist" - Use when adding content to a playlist diff --git a/Sources/TranslateKitEntertainmentLite/TK+Label.swift b/Sources/TranslateKitEntertainment/TK+Label.swift similarity index 99% rename from Sources/TranslateKitEntertainmentLite/TK+Label.swift rename to Sources/TranslateKitEntertainment/TK+Label.swift index 6c309b2..57fb1c8 100644 --- a/Sources/TranslateKitEntertainmentLite/TK+Label.swift +++ b/Sources/TranslateKitEntertainment/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Actors" - Use for the list of actors involved in content diff --git a/Sources/TranslateKitEntertainmentLite/TK+Message.swift b/Sources/TranslateKitEntertainment/TK+Message.swift similarity index 99% rename from Sources/TranslateKitEntertainmentLite/TK+Message.swift rename to Sources/TranslateKitEntertainment/TK+Message.swift index 4d7f8c5..8a1b7b6 100644 --- a/Sources/TranslateKitEntertainmentLite/TK+Message.swift +++ b/Sources/TranslateKitEntertainment/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "A new version is available for streaming." - Notification about a new streaming version diff --git a/Sources/TranslateKitEntertainmentLite/TK+Placeholder.swift b/Sources/TranslateKitEntertainment/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitEntertainmentLite/TK+Placeholder.swift rename to Sources/TranslateKitEntertainment/TK+Placeholder.swift index c0acea4..0c2533f 100644 --- a/Sources/TranslateKitEntertainmentLite/TK+Placeholder.swift +++ b/Sources/TranslateKitEntertainment/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a caption…" - Placeholder for adding a caption diff --git a/Sources/TranslateKitFinance/Exports.swift b/Sources/TranslateKitFinance/Exports.swift deleted file mode 100644 index e64d91b..0000000 --- a/Sources/TranslateKitFinance/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitFinanceLite diff --git a/Sources/TranslateKitFinanceLite/Localizable.xcstrings b/Sources/TranslateKitFinance/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitFinanceLite/Localizable.xcstrings rename to Sources/TranslateKitFinance/Localizable.xcstrings diff --git a/Sources/TranslateKitFinanceLite/TK+Action.swift b/Sources/TranslateKitFinance/TK+Action.swift similarity index 99% rename from Sources/TranslateKitFinanceLite/TK+Action.swift rename to Sources/TranslateKitFinance/TK+Action.swift index 10df60b..86c9f06 100644 --- a/Sources/TranslateKitFinanceLite/TK+Action.swift +++ b/Sources/TranslateKitFinance/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Add Account" - Use for adding a new user account diff --git a/Sources/TranslateKitFinanceLite/TK+Label.swift b/Sources/TranslateKitFinance/TK+Label.swift similarity index 99% rename from Sources/TranslateKitFinanceLite/TK+Label.swift rename to Sources/TranslateKitFinance/TK+Label.swift index 0fdc1e2..39e4d37 100644 --- a/Sources/TranslateKitFinanceLite/TK+Label.swift +++ b/Sources/TranslateKitFinance/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Account Number" - Use for labeling the account number field diff --git a/Sources/TranslateKitFinanceLite/TK+Message.swift b/Sources/TranslateKitFinance/TK+Message.swift similarity index 99% rename from Sources/TranslateKitFinanceLite/TK+Message.swift rename to Sources/TranslateKitFinance/TK+Message.swift index 71714b9..e1a8569 100644 --- a/Sources/TranslateKitFinanceLite/TK+Message.swift +++ b/Sources/TranslateKitFinance/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Account Locked After Multiple Attempts" - Message indicating account is locked after multiple failed attempts diff --git a/Sources/TranslateKitFinanceLite/TK+Placeholder.swift b/Sources/TranslateKitFinance/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitFinanceLite/TK+Placeholder.swift rename to Sources/TranslateKitFinance/TK+Placeholder.swift index 6de371f..661f3b5 100644 --- a/Sources/TranslateKitFinanceLite/TK+Placeholder.swift +++ b/Sources/TranslateKitFinance/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add expense details…" - Placeholder for adding expense details diff --git a/Sources/TranslateKitFoodAndDrink/Exports.swift b/Sources/TranslateKitFoodAndDrink/Exports.swift deleted file mode 100644 index 318739e..0000000 --- a/Sources/TranslateKitFoodAndDrink/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitFoodAndDrinkLite diff --git a/Sources/TranslateKitFoodAndDrinkLite/Localizable.xcstrings b/Sources/TranslateKitFoodAndDrink/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitFoodAndDrinkLite/Localizable.xcstrings rename to Sources/TranslateKitFoodAndDrink/Localizable.xcstrings diff --git a/Sources/TranslateKitFoodAndDrinkLite/TK+Action.swift b/Sources/TranslateKitFoodAndDrink/TK+Action.swift similarity index 99% rename from Sources/TranslateKitFoodAndDrinkLite/TK+Action.swift rename to Sources/TranslateKitFoodAndDrink/TK+Action.swift index 9fe9111..59b345a 100644 --- a/Sources/TranslateKitFoodAndDrinkLite/TK+Action.swift +++ b/Sources/TranslateKitFoodAndDrink/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Add to Cart" - Use when adding an item to the shopping cart diff --git a/Sources/TranslateKitFoodAndDrinkLite/TK+Label.swift b/Sources/TranslateKitFoodAndDrink/TK+Label.swift similarity index 99% rename from Sources/TranslateKitFoodAndDrinkLite/TK+Label.swift rename to Sources/TranslateKitFoodAndDrink/TK+Label.swift index 3ce1923..4fa7d29 100644 --- a/Sources/TranslateKitFoodAndDrinkLite/TK+Label.swift +++ b/Sources/TranslateKitFoodAndDrink/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Allergens" - Use for identifying allergens in food items diff --git a/Sources/TranslateKitFoodAndDrinkLite/TK+Message.swift b/Sources/TranslateKitFoodAndDrink/TK+Message.swift similarity index 99% rename from Sources/TranslateKitFoodAndDrinkLite/TK+Message.swift rename to Sources/TranslateKitFoodAndDrink/TK+Message.swift index a44d0d1..6ceb7e8 100644 --- a/Sources/TranslateKitFoodAndDrinkLite/TK+Message.swift +++ b/Sources/TranslateKitFoodAndDrink/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Delivery order confirmed" - Confirmation message when an order is confirmed for delivery diff --git a/Sources/TranslateKitFoodAndDrinkLite/TK+Placeholder.swift b/Sources/TranslateKitFoodAndDrink/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitFoodAndDrinkLite/TK+Placeholder.swift rename to Sources/TranslateKitFoodAndDrink/TK+Placeholder.swift index 339bec4..aa4ee91 100644 --- a/Sources/TranslateKitFoodAndDrinkLite/TK+Placeholder.swift +++ b/Sources/TranslateKitFoodAndDrink/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add delivery instructions…" - Placeholder for adding special instructions for delivery diff --git a/Sources/TranslateKitGames/Exports.swift b/Sources/TranslateKitGames/Exports.swift deleted file mode 100644 index a6168f1..0000000 --- a/Sources/TranslateKitGames/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitGamesLite diff --git a/Sources/TranslateKitGamesLite/Localizable.xcstrings b/Sources/TranslateKitGames/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitGamesLite/Localizable.xcstrings rename to Sources/TranslateKitGames/Localizable.xcstrings diff --git a/Sources/TranslateKitGamesLite/TK+Action.swift b/Sources/TranslateKitGames/TK+Action.swift similarity index 99% rename from Sources/TranslateKitGamesLite/TK+Action.swift rename to Sources/TranslateKitGames/TK+Action.swift index dff3333..ab26fc9 100644 --- a/Sources/TranslateKitGamesLite/TK+Action.swift +++ b/Sources/TranslateKitGames/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Play Now" - Use when starting gameplay immediately diff --git a/Sources/TranslateKitGamesLite/TK+Label.swift b/Sources/TranslateKitGames/TK+Label.swift similarity index 99% rename from Sources/TranslateKitGamesLite/TK+Label.swift rename to Sources/TranslateKitGames/TK+Label.swift index e10eb5c..99cdad6 100644 --- a/Sources/TranslateKitGamesLite/TK+Label.swift +++ b/Sources/TranslateKitGames/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Score" - Use for displaying current score in a game diff --git a/Sources/TranslateKitGamesLite/TK+Message.swift b/Sources/TranslateKitGames/TK+Message.swift similarity index 99% rename from Sources/TranslateKitGamesLite/TK+Message.swift rename to Sources/TranslateKitGames/TK+Message.swift index c6cab12..31f373b 100644 --- a/Sources/TranslateKitGamesLite/TK+Message.swift +++ b/Sources/TranslateKitGames/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Game Over" - Message displayed when the game ends diff --git a/Sources/TranslateKitGamesLite/TK+Placeholder.swift b/Sources/TranslateKitGames/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitGamesLite/TK+Placeholder.swift rename to Sources/TranslateKitGames/TK+Placeholder.swift index 0ad9cfc..5ac2fc1 100644 --- a/Sources/TranslateKitGamesLite/TK+Placeholder.swift +++ b/Sources/TranslateKitGames/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Matchmaking…" - Shown when searching for players or opponents diff --git a/Sources/TranslateKitGraphicsAndDesign/Exports.swift b/Sources/TranslateKitGraphicsAndDesign/Exports.swift deleted file mode 100644 index fd33658..0000000 --- a/Sources/TranslateKitGraphicsAndDesign/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitGraphicsAndDesignLite diff --git a/Sources/TranslateKitGraphicsAndDesignLite/Localizable.xcstrings b/Sources/TranslateKitGraphicsAndDesign/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitGraphicsAndDesignLite/Localizable.xcstrings rename to Sources/TranslateKitGraphicsAndDesign/Localizable.xcstrings diff --git a/Sources/TranslateKitGraphicsAndDesignLite/TK+Action.swift b/Sources/TranslateKitGraphicsAndDesign/TK+Action.swift similarity index 99% rename from Sources/TranslateKitGraphicsAndDesignLite/TK+Action.swift rename to Sources/TranslateKitGraphicsAndDesign/TK+Action.swift index 5f42d9e..c7de597 100644 --- a/Sources/TranslateKitGraphicsAndDesignLite/TK+Action.swift +++ b/Sources/TranslateKitGraphicsAndDesign/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Align" - Use for aligning elements in a design diff --git a/Sources/TranslateKitGraphicsAndDesignLite/TK+Label.swift b/Sources/TranslateKitGraphicsAndDesign/TK+Label.swift similarity index 99% rename from Sources/TranslateKitGraphicsAndDesignLite/TK+Label.swift rename to Sources/TranslateKitGraphicsAndDesign/TK+Label.swift index a16459d..8a00740 100644 --- a/Sources/TranslateKitGraphicsAndDesignLite/TK+Label.swift +++ b/Sources/TranslateKitGraphicsAndDesign/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Alignment" - Use when referring to the positioning of elements diff --git a/Sources/TranslateKitGraphicsAndDesignLite/TK+Message.swift b/Sources/TranslateKitGraphicsAndDesign/TK+Message.swift similarity index 99% rename from Sources/TranslateKitGraphicsAndDesignLite/TK+Message.swift rename to Sources/TranslateKitGraphicsAndDesign/TK+Message.swift index 0fc15c1..07057b6 100644 --- a/Sources/TranslateKitGraphicsAndDesignLite/TK+Message.swift +++ b/Sources/TranslateKitGraphicsAndDesign/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Artboard is empty." - Displayed when there are no elements in the artboard diff --git a/Sources/TranslateKitGraphicsAndDesignLite/TK+Placeholder.swift b/Sources/TranslateKitGraphicsAndDesign/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitGraphicsAndDesignLite/TK+Placeholder.swift rename to Sources/TranslateKitGraphicsAndDesign/TK+Placeholder.swift index 90cfbf3..6109f18 100644 --- a/Sources/TranslateKitGraphicsAndDesignLite/TK+Placeholder.swift +++ b/Sources/TranslateKitGraphicsAndDesign/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Adjust opacity…" - Placeholder text for adjusting opacity diff --git a/Sources/TranslateKitHealthAndFitness/Exports.swift b/Sources/TranslateKitHealthAndFitness/Exports.swift deleted file mode 100644 index a63060b..0000000 --- a/Sources/TranslateKitHealthAndFitness/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitHealthAndFitnessLite diff --git a/Sources/TranslateKitHealthAndFitnessLite/Localizable.xcstrings b/Sources/TranslateKitHealthAndFitness/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitHealthAndFitnessLite/Localizable.xcstrings rename to Sources/TranslateKitHealthAndFitness/Localizable.xcstrings diff --git a/Sources/TranslateKitHealthAndFitnessLite/TK+Action.swift b/Sources/TranslateKitHealthAndFitness/TK+Action.swift similarity index 99% rename from Sources/TranslateKitHealthAndFitnessLite/TK+Action.swift rename to Sources/TranslateKitHealthAndFitness/TK+Action.swift index 7781d0e..7d696db 100644 --- a/Sources/TranslateKitHealthAndFitnessLite/TK+Action.swift +++ b/Sources/TranslateKitHealthAndFitness/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Add Measurement" - Use when adding a new measurement (e.g., weight, blood pressure) diff --git a/Sources/TranslateKitHealthAndFitnessLite/TK+Label.swift b/Sources/TranslateKitHealthAndFitness/TK+Label.swift similarity index 99% rename from Sources/TranslateKitHealthAndFitnessLite/TK+Label.swift rename to Sources/TranslateKitHealthAndFitness/TK+Label.swift index 1358264..3c855d3 100644 --- a/Sources/TranslateKitHealthAndFitnessLite/TK+Label.swift +++ b/Sources/TranslateKitHealthAndFitness/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Active Calories" - Use when displaying the number of calories burned through activity diff --git a/Sources/TranslateKitHealthAndFitnessLite/TK+Message.swift b/Sources/TranslateKitHealthAndFitness/TK+Message.swift similarity index 99% rename from Sources/TranslateKitHealthAndFitnessLite/TK+Message.swift rename to Sources/TranslateKitHealthAndFitness/TK+Message.swift index fabaa8b..ec18268 100644 --- a/Sources/TranslateKitHealthAndFitnessLite/TK+Message.swift +++ b/Sources/TranslateKitHealthAndFitness/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Achievement unlocked!" - Message when a user achieves a milestone or accomplishment diff --git a/Sources/TranslateKitHealthAndFitnessLite/TK+Placeholder.swift b/Sources/TranslateKitHealthAndFitness/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitHealthAndFitnessLite/TK+Placeholder.swift rename to Sources/TranslateKitHealthAndFitness/TK+Placeholder.swift index 016cdc7..7d5e68c 100644 --- a/Sources/TranslateKitHealthAndFitnessLite/TK+Placeholder.swift +++ b/Sources/TranslateKitHealthAndFitness/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add workout details…" - Placeholder for entering workout details diff --git a/Sources/TranslateKitLifestyle/Exports.swift b/Sources/TranslateKitLifestyle/Exports.swift deleted file mode 100644 index f5b1ed4..0000000 --- a/Sources/TranslateKitLifestyle/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitLifestyleLite diff --git a/Sources/TranslateKitLifestyleLite/Localizable.xcstrings b/Sources/TranslateKitLifestyle/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitLifestyleLite/Localizable.xcstrings rename to Sources/TranslateKitLifestyle/Localizable.xcstrings diff --git a/Sources/TranslateKitLifestyleLite/TK+Action.swift b/Sources/TranslateKitLifestyle/TK+Action.swift similarity index 99% rename from Sources/TranslateKitLifestyleLite/TK+Action.swift rename to Sources/TranslateKitLifestyle/TK+Action.swift index 503692a..1c79d92 100644 --- a/Sources/TranslateKitLifestyleLite/TK+Action.swift +++ b/Sources/TranslateKitLifestyle/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Archive" - Use when saving or moving content for later access diff --git a/Sources/TranslateKitLifestyleLite/TK+Label.swift b/Sources/TranslateKitLifestyle/TK+Label.swift similarity index 99% rename from Sources/TranslateKitLifestyleLite/TK+Label.swift rename to Sources/TranslateKitLifestyle/TK+Label.swift index aeb522d..3271e60 100644 --- a/Sources/TranslateKitLifestyleLite/TK+Label.swift +++ b/Sources/TranslateKitLifestyle/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Achievement Points" - Reward metrics or points for accomplishments diff --git a/Sources/TranslateKitLifestyleLite/TK+Message.swift b/Sources/TranslateKitLifestyle/TK+Message.swift similarity index 99% rename from Sources/TranslateKitLifestyleLite/TK+Message.swift rename to Sources/TranslateKitLifestyle/TK+Message.swift index d4fe881..b8e2d85 100644 --- a/Sources/TranslateKitLifestyleLite/TK+Message.swift +++ b/Sources/TranslateKitLifestyle/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Achievement unlocked!" - Message when a user achieves a milestone or accomplishment diff --git a/Sources/TranslateKitLifestyleLite/TK+Placeholder.swift b/Sources/TranslateKitLifestyle/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitLifestyleLite/TK+Placeholder.swift rename to Sources/TranslateKitLifestyle/TK+Placeholder.swift index 0bb6c34..42c8168 100644 --- a/Sources/TranslateKitLifestyleLite/TK+Placeholder.swift +++ b/Sources/TranslateKitLifestyle/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a caption…" - Placeholder for adding a caption to an image or media diff --git a/Sources/TranslateKitMacros/StringExt.swift b/Sources/TranslateKitMacros/StringExt.swift deleted file mode 100644 index 4310d41..0000000 --- a/Sources/TranslateKitMacros/StringExt.swift +++ /dev/null @@ -1,121 +0,0 @@ -import Foundation - -extension String { - var trimmingQuotes: String { - self.trimmingCharacters(in: CharacterSet(charactersIn: "\"")) - } - - var removingQuotationMarks: String { - String(self.filter { !$0.unicodeScalars.contains { $0.properties.isQuotationMark } }) - } - - /// Converts the string to UpperCamelCase, preserving existing uppercase characters. - /// - /// - Returns: A UpperCamelCased version of the string. - /// - /// Examples: - /// - "displayName" -> "DisplayName" - /// - "body" -> "Body" - /// - "RESTClient" -> "RESTClient" - /// - "commonAPIGuidelines" -> "CommonAPIGuidelines" - func toUpperCamelCase() -> String { - // Create a character array to manipulate, remove all ' to map things like "it's" to "its" to keep them one word - let characters = Array(self.removingQuotationMarks) - var result: [Character] = [] - - // Flag to track if we should uppercase the next character - var uppercaseNext = true - - for (index, char) in characters.enumerated() { - // Skip non-alphanumeric characters - guard char.isLetter || char.isNumber else { - uppercaseNext = true - continue - } - - if uppercaseNext { - // Uppercase only if the character is not already uppercase - result.append(char.isUppercase ? char : char.uppercased().first!) - uppercaseNext = false - } else { - // Keep existing characters as they are - result.append(char) - } - - // Set uppercaseNext to true if the next character is not alphanumeric - if index < characters.count - 1 { - let nextChar = characters[index + 1] - if !(nextChar.isLetter || nextChar.isNumber) { - uppercaseNext = true - } - } - } - - return String(result).folding(options: .diacriticInsensitive, locale: Locale(identifier: "en-US")) - } - - /// Converts the string to lowerCamelCase, preserving sentence punctuation and handling various input formats. - /// - /// - Parameters: - /// - maxWords: Maximum number of words to process (default is 10 for long texts) - /// - Returns: A lowerCamelCased version of the string, with "..." added if truncated - /// - /// Examples: - /// - "Hello World!" -> "helloWorld!" - /// - "What's your name?" -> "whatsYourName?" - /// - "Super-Fast" -> "superFast" - /// - "TV Show" -> "tvShow" - /// - "Chris Latter: 'Let's make Swift #1!'" -> "chrisLattnerLetsMakeSwift#1" - /// - Long text will be truncated to first 10 words with "..." added - func toLowerCamelCase(maxWords: Int = 10) -> String { - var words: [String] = [] - - var wordChars: [Character] = [] - let upperCamelCasedCharacters = Array(self.toUpperCamelCase()) - - guard !upperCamelCasedCharacters.isEmpty else { return "" } - - // Determine if text is truncated - var isTruncated = false - - for (index, char) in upperCamelCasedCharacters.enumerated() { - guard words.count < maxWords else { - isTruncated = true - break - } - - wordChars.append(char) - - // detect if new word needs to be started - if index < upperCamelCasedCharacters.count - 1 { - let nextChar = upperCamelCasedCharacters[index + 1] - - // All possible cases of [current char][next char]: - // New word if: aA, a1, A1, 1A - // Within word if: AA, Aa, 11, 1a - if (nextChar.isUppercase && !char.isUppercase) || (nextChar.isNumber && !char.isNumber) { - - words.append(String(wordChars)) - wordChars = [] - } - - // except when AAa is found, then also end word - if index < upperCamelCasedCharacters.count - 2, char.isUppercase, nextChar.isUppercase { - let charAfterNextChar = upperCamelCasedCharacters[index + 2] - if !charAfterNextChar.isUppercase { - words.append(String(wordChars)) - wordChars = [] - } - } - } else { - // finalize last word - words.append(String(wordChars)) - } - } - - // lowercase first word - words[0] = words[0].lowercased() - - return words.joined() + (isTruncated ? "…" : "") - } -} diff --git a/Sources/TranslateKitMacros/TranslateKitPlugin.swift b/Sources/TranslateKitMacros/TranslateKitPlugin.swift deleted file mode 100644 index 9646ce0..0000000 --- a/Sources/TranslateKitMacros/TranslateKitPlugin.swift +++ /dev/null @@ -1,7 +0,0 @@ -import SwiftCompilerPlugin -import SwiftSyntaxMacros - -@main -struct TranslateKitPlugin: CompilerPlugin { - let providingMacros: [Macro.Type] = [TranslationKey.self, TranslationKeyModule.self] -} diff --git a/Sources/TranslateKitMacros/TranslationKey.swift b/Sources/TranslateKitMacros/TranslationKey.swift deleted file mode 100644 index 1237350..0000000 --- a/Sources/TranslateKitMacros/TranslationKey.swift +++ /dev/null @@ -1,184 +0,0 @@ -import Foundation -import SwiftDiagnostics -import SwiftSyntax -import SwiftSyntaxMacros - -public struct TranslationKey: ExpressionMacro { - /// Constructing code like: `String(localized: "MyView.Body.Button.saveChanges", defaultValue: "Save Changes", bundle: .module, comment: "Save button in settings view")` - public static func expansion( - of node: some FreestandingMacroExpansionSyntax, - in context: some MacroExpansionContext - ) throws -> ExprSyntax { - guard let argumentList = node.as(MacroExpansionExprSyntax.self)?.arguments else { - fatalError("Expected arguments in macro expansion") - } - - let defaultValue = self.defaultValue(node: node) - var comment: ExprSyntax? - - // Extract optional comment argument - for argument in argumentList { - if let label = argument.label?.text { - if label == "c" { - comment = argument.expression - } - } - } - - // constructing: `"Save Changes"` - let defaultValueLiteral = StringLiteralExprSyntax( - openingQuote: .stringQuoteToken(), - segments: StringLiteralSegmentListSyntax([.stringSegment(.init(content: .stringSegment(defaultValue)))]), - closingQuote: .stringQuoteToken() - ) - - // constructing: `"SomeView.Body.Button.saveChanges"` - let localizedLiteral = StringLiteralExprSyntax( - openingQuote: .stringQuoteToken(), - segments: StringLiteralSegmentListSyntax([ - .stringSegment(.init(content: .stringSegment(self.semanticKey(context: context, defaultValue: defaultValue)))) - ]), - closingQuote: .stringQuoteToken() - ) - - // constructing: `localized: "SomeView.Body.Button.saveChanges", defaultValue: "Save Changes"` (plus optional comment) - var arguments = LabeledExprListSyntax { - LabeledExprSyntax(label: .identifier("localized"), colon: .colonToken(), expression: localizedLiteral) - LabeledExprSyntax( - label: .identifier("defaultValue"), - colon: .colonToken(), - expression: defaultValueLiteral, - trailingComma: comment != nil ? .commaToken() : nil - ) - } - - // Add comment argument if provided - if let comment { - arguments.append( - LabeledExprSyntax(label: .identifier("comment"), colon: .colonToken(), expression: comment) - ) - } - - // constructing: `String(localized: "SomeView.Body.Button.saveChanges", defaultValue: "Save Changes", comment: comment)` - let functionCall = FunctionCallExprSyntax( - calledExpression: ExprSyntax(DeclReferenceExprSyntax(baseName: "String")), - leftParen: .leftParenToken(), - arguments: arguments, - rightParen: .rightParenToken() - ) - - return ExprSyntax(functionCall) - } - - /// Returns `MyView.Body.saveChanges` for the following view: - /// ```swift - /// struct MyView: View { - /// var body: some View { - /// Button(#tk("Save Changes")) { - /// self.handleSave() - /// } - /// } - /// } - /// ``` - /// Or `MyModel.DisplayName.movie` and `MyModel.DisplayName.tvShow` for the following model: - /// ```swift - /// enum MyModel: String, CaseIterable, Codable { - /// case movie - /// case series - /// - /// var displayName: String { - /// switch self { - /// case .movie: #tk("Movie") - /// case .series: #tk("TV Show") - /// } - /// } - /// } - /// ``` - /// - NOTE: Use https://swift-ast-explorer.com for development. - static func semanticKey(context: some MacroExpansionContext, defaultValue: String) -> String { - var result: [String] = [] - - // Traverse each element in the lexical context - for syntaxNode in context.lexicalContext.reversed() { - // Handle struct declarations - if let structDecl = syntaxNode.as(StructDeclSyntax.self) { - result.append(structDecl.name.text.toUpperCamelCase()) - } - // Handle class declarations - else if let classDecl = syntaxNode.as(ClassDeclSyntax.self) { - result.append(classDecl.name.text.toUpperCamelCase()) - } - // Handle enum declarations - else if let enumDecl = syntaxNode.as(EnumDeclSyntax.self) { - result.append(enumDecl.name.text.toUpperCamelCase()) - } - // Handle extension declarations - else if let extensionDecl = syntaxNode.as(ExtensionDeclSyntax.self) { - var typeNames: [String] = [] - var currentType: TypeSyntaxProtocol? = extensionDecl.extendedType - - while let memberType = currentType?.as(MemberTypeSyntax.self) { - typeNames.append(memberType.name.text.toUpperCamelCase()) - currentType = memberType.baseType - } - - // If the base type is an IdentifierTypeSyntax (single-word type like `TK`), add it - if let baseIdentifier = currentType?.as(IdentifierTypeSyntax.self) { - typeNames.append(baseIdentifier.name.text.toUpperCamelCase()) - } - - // Append these to the result - result.append(contentsOf: typeNames.reversed()) // Ensure correct order - } - - // Handle function declarations - else if let funcDecl = syntaxNode.as(FunctionDeclSyntax.self) { - result.append(funcDecl.name.text.toUpperCamelCase()) - } - // Handle initializer declarations - else if syntaxNode.as(InitializerDeclSyntax.self) != nil { - result.append("init") - } - // Handle property declarations (stored or computed) - else if let varDecl = syntaxNode.as(VariableDeclSyntax.self) { - for binding in varDecl.bindings { - if let identifierPattern = binding.pattern.as(IdentifierPatternSyntax.self) { - // If it's a computed property (like displayName) - result.append(identifierPattern.identifier.text.toUpperCamelCase()) - } - } - } - // Handle case of pattern binding, like enum cases or computed properties - else if let patternBinding = syntaxNode.as(PatternBindingSyntax.self) { - if let identifierPattern = patternBinding.pattern.as(IdentifierPatternSyntax.self) { - result.append(identifierPattern.identifier.text.toUpperCamelCase()) - } - } - } - - let key = - if defaultValue.hasSuffix("…") { - String(defaultValue.dropLast()).toLowerCamelCase() + "Dots" - } else if defaultValue.count > 3 && defaultValue.uppercased() == defaultValue { - defaultValue // Keep it uppercase as is - } else { - defaultValue.toLowerCamelCase() - } - result.append(key) - - return result.joined(separator: ".") - } - - static func defaultValue(node: some FreestandingMacroExpansionSyntax) -> String { - // Extract string literal from macro expansion - if let argumentList = node.as(MacroExpansionExprSyntax.self)?.arguments { - for argument in argumentList { - if let stringLiteral = argument.expression.as(StringLiteralExprSyntax.self) { - return stringLiteral.segments.description.trimmingQuotes - } - } - } - - fatalError("Expected #tk macro call to contain a string literal representing the default value in the source language.") - } -} diff --git a/Sources/TranslateKitMacros/TranslationKeyModule.swift b/Sources/TranslateKitMacros/TranslationKeyModule.swift deleted file mode 100644 index 833d061..0000000 --- a/Sources/TranslateKitMacros/TranslationKeyModule.swift +++ /dev/null @@ -1,89 +0,0 @@ -import Foundation -import SwiftDiagnostics -import SwiftSyntax -import SwiftSyntaxMacros - -public struct TranslationKeyModule: ExpressionMacro { - /// Constructing code like: `String(localized: "MyView.Body.Button.saveChanges", defaultValue: "Save Changes", bundle: .module, comment: "Save button in settings view")` - public static func expansion( - of node: some FreestandingMacroExpansionSyntax, - in context: some MacroExpansionContext - ) throws -> ExprSyntax { - guard let argumentList = node.as(MacroExpansionExprSyntax.self)?.arguments else { - fatalError("Expected arguments in macro expansion") - } - - let defaultValue = self.defaultValue(node: node) - var comment: ExprSyntax? - - // Extract optional comment argument - for argument in argumentList { - if let label = argument.label?.text { - if label == "c" { - comment = argument.expression - } - } - } - - // constructing: `"Save Changes"` - let defaultValueLiteral = StringLiteralExprSyntax( - openingQuote: .stringQuoteToken(), - segments: StringLiteralSegmentListSyntax([.stringSegment(.init(content: .stringSegment(defaultValue)))]), - closingQuote: .stringQuoteToken() - ) - - // constructing: `"SomeView.Body.Button.saveChanges"` - let localizedLiteral = StringLiteralExprSyntax( - openingQuote: .stringQuoteToken(), - segments: StringLiteralSegmentListSyntax([ - .stringSegment(.init(content: .stringSegment(self.semanticKey(context: context, defaultValue: defaultValue)))) - ]), - closingQuote: .stringQuoteToken() - ) - - // constructing: `Bundle.module` - let moduleReference = MemberAccessExprSyntax( - base: DeclReferenceExprSyntax(baseName: .identifier("Bundle")), - period: .periodToken(), - name: .identifier("module") - ) - - // constructing: `localized: "SomeView.Body.Button.saveChanges", defaultValue: "Save Changes", bundle: .module` (plus optional comment) - var arguments = LabeledExprListSyntax { - LabeledExprSyntax(label: .identifier("localized"), colon: .colonToken(), expression: localizedLiteral) - LabeledExprSyntax(label: .identifier("defaultValue"), colon: .colonToken(), expression: defaultValueLiteral, trailingComma: .commaToken()) - LabeledExprSyntax( - label: .identifier("bundle"), - colon: .colonToken(), - expression: ExprSyntax(moduleReference), - trailingComma: comment != nil ? .commaToken() : nil - ) - } - - // Add comment argument if provided - if let comment { - arguments.append( - LabeledExprSyntax(label: .identifier("comment"), colon: .colonToken(), expression: comment) - ) - } - - // constructing: `String(localized: "SomeView.Body.Button.saveChanges", defaultValue: "Save Changes", bundle: .module, comment: comment)` - let functionCall = FunctionCallExprSyntax( - calledExpression: ExprSyntax(DeclReferenceExprSyntax(baseName: "String")), - leftParen: .leftParenToken(), - arguments: arguments, - rightParen: .rightParenToken() - ) - - return ExprSyntax(functionCall) - } - - // Share the same helper methods from TranslationKey - private static func semanticKey(context: some MacroExpansionContext, defaultValue: String) -> String { - TranslationKey.semanticKey(context: context, defaultValue: defaultValue) - } - - private static func defaultValue(node: some FreestandingMacroExpansionSyntax) -> String { - TranslationKey.defaultValue(node: node) - } -} diff --git a/Sources/TranslateKitMagazinesAndNewspapers/Exports.swift b/Sources/TranslateKitMagazinesAndNewspapers/Exports.swift deleted file mode 100644 index eee1359..0000000 --- a/Sources/TranslateKitMagazinesAndNewspapers/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitMagazinesAndNewspapersLite diff --git a/Sources/TranslateKitMagazinesAndNewspapersLite/Localizable.xcstrings b/Sources/TranslateKitMagazinesAndNewspapers/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitMagazinesAndNewspapersLite/Localizable.xcstrings rename to Sources/TranslateKitMagazinesAndNewspapers/Localizable.xcstrings diff --git a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Action.swift b/Sources/TranslateKitMagazinesAndNewspapers/TK+Action.swift similarity index 99% rename from Sources/TranslateKitMagazinesAndNewspapersLite/TK+Action.swift rename to Sources/TranslateKitMagazinesAndNewspapers/TK+Action.swift index 6708bef..34f0462 100644 --- a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Action.swift +++ b/Sources/TranslateKitMagazinesAndNewspapers/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Archive" - Use when moving content to long-term storage diff --git a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Label.swift b/Sources/TranslateKitMagazinesAndNewspapers/TK+Label.swift similarity index 99% rename from Sources/TranslateKitMagazinesAndNewspapersLite/TK+Label.swift rename to Sources/TranslateKitMagazinesAndNewspapers/TK+Label.swift index 56424b1..9fdb9dd 100644 --- a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Label.swift +++ b/Sources/TranslateKitMagazinesAndNewspapers/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Archives" - Use for sections containing past issues or content diff --git a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Message.swift b/Sources/TranslateKitMagazinesAndNewspapers/TK+Message.swift similarity index 99% rename from Sources/TranslateKitMagazinesAndNewspapersLite/TK+Message.swift rename to Sources/TranslateKitMagazinesAndNewspapers/TK+Message.swift index 78740f9..cf48491 100644 --- a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Message.swift +++ b/Sources/TranslateKitMagazinesAndNewspapers/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Article added to your bookmarks." - Confirmation when saving an article to bookmarks diff --git a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Placeholder.swift b/Sources/TranslateKitMagazinesAndNewspapers/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitMagazinesAndNewspapersLite/TK+Placeholder.swift rename to Sources/TranslateKitMagazinesAndNewspapers/TK+Placeholder.swift index 9810f80..e06cd7b 100644 --- a/Sources/TranslateKitMagazinesAndNewspapersLite/TK+Placeholder.swift +++ b/Sources/TranslateKitMagazinesAndNewspapers/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a caption…" - Placeholder for entering a caption for an image or media diff --git a/Sources/TranslateKitMedical/Exports.swift b/Sources/TranslateKitMedical/Exports.swift deleted file mode 100644 index 238123e..0000000 --- a/Sources/TranslateKitMedical/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitMedicalLite diff --git a/Sources/TranslateKitMedicalLite/Localizable.xcstrings b/Sources/TranslateKitMedical/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitMedicalLite/Localizable.xcstrings rename to Sources/TranslateKitMedical/Localizable.xcstrings diff --git a/Sources/TranslateKitMedicalLite/TK+Action.swift b/Sources/TranslateKitMedical/TK+Action.swift similarity index 99% rename from Sources/TranslateKitMedicalLite/TK+Action.swift rename to Sources/TranslateKitMedical/TK+Action.swift index 8d9b3af..1554d86 100644 --- a/Sources/TranslateKitMedicalLite/TK+Action.swift +++ b/Sources/TranslateKitMedical/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Analyze" - Use for analyzing medical data or results diff --git a/Sources/TranslateKitMedicalLite/TK+Label.swift b/Sources/TranslateKitMedical/TK+Label.swift similarity index 99% rename from Sources/TranslateKitMedicalLite/TK+Label.swift rename to Sources/TranslateKitMedical/TK+Label.swift index 20ab376..e49287c 100644 --- a/Sources/TranslateKitMedicalLite/TK+Label.swift +++ b/Sources/TranslateKitMedical/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Address" - Use for labeling address fields diff --git a/Sources/TranslateKitMedicalLite/TK+Message.swift b/Sources/TranslateKitMedical/TK+Message.swift similarity index 99% rename from Sources/TranslateKitMedicalLite/TK+Message.swift rename to Sources/TranslateKitMedical/TK+Message.swift index efdd67e..5eb912e 100644 --- a/Sources/TranslateKitMedicalLite/TK+Message.swift +++ b/Sources/TranslateKitMedical/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Abnormal reading detected." - Use to notify of an abnormal medical reading diff --git a/Sources/TranslateKitMedicalLite/TK+Placeholder.swift b/Sources/TranslateKitMedical/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitMedicalLite/TK+Placeholder.swift rename to Sources/TranslateKitMedical/TK+Placeholder.swift index 812a6de..1584e85 100644 --- a/Sources/TranslateKitMedicalLite/TK+Placeholder.swift +++ b/Sources/TranslateKitMedical/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add symptoms…" - Placeholder for entering symptoms diff --git a/Sources/TranslateKitMusic/Exports.swift b/Sources/TranslateKitMusic/Exports.swift deleted file mode 100644 index a8059c8..0000000 --- a/Sources/TranslateKitMusic/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitMusicLite diff --git a/Sources/TranslateKitMusicLite/Localizable.xcstrings b/Sources/TranslateKitMusic/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitMusicLite/Localizable.xcstrings rename to Sources/TranslateKitMusic/Localizable.xcstrings diff --git a/Sources/TranslateKitMusicLite/TK+Action.swift b/Sources/TranslateKitMusic/TK+Action.swift similarity index 99% rename from Sources/TranslateKitMusicLite/TK+Action.swift rename to Sources/TranslateKitMusic/TK+Action.swift index c0eeff6..49a00bc 100644 --- a/Sources/TranslateKitMusicLite/TK+Action.swift +++ b/Sources/TranslateKitMusic/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Record" - Use when starting to record audio or music diff --git a/Sources/TranslateKitMusicLite/TK+Label.swift b/Sources/TranslateKitMusic/TK+Label.swift similarity index 99% rename from Sources/TranslateKitMusicLite/TK+Label.swift rename to Sources/TranslateKitMusic/TK+Label.swift index 56424b1..9fdb9dd 100644 --- a/Sources/TranslateKitMusicLite/TK+Label.swift +++ b/Sources/TranslateKitMusic/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Archives" - Use for sections containing past issues or content diff --git a/Sources/TranslateKitMusicLite/TK+Message.swift b/Sources/TranslateKitMusic/TK+Message.swift similarity index 99% rename from Sources/TranslateKitMusicLite/TK+Message.swift rename to Sources/TranslateKitMusic/TK+Message.swift index 886efab..8dde6c4 100644 --- a/Sources/TranslateKitMusicLite/TK+Message.swift +++ b/Sources/TranslateKitMusic/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "No audio input detected" - Message when no audio input is found diff --git a/Sources/TranslateKitMusicLite/TK+Placeholder.swift b/Sources/TranslateKitMusic/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitMusicLite/TK+Placeholder.swift rename to Sources/TranslateKitMusic/TK+Placeholder.swift index 3540706..f780571 100644 --- a/Sources/TranslateKitMusicLite/TK+Placeholder.swift +++ b/Sources/TranslateKitMusic/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Tuning to A4 (440 Hz)…" - Placeholder while tuning to A4 diff --git a/Sources/TranslateKitNavigation/Exports.swift b/Sources/TranslateKitNavigation/Exports.swift deleted file mode 100644 index 14af38e..0000000 --- a/Sources/TranslateKitNavigation/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitNavigationLite diff --git a/Sources/TranslateKitNavigationLite/Localizable.xcstrings b/Sources/TranslateKitNavigation/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitNavigationLite/Localizable.xcstrings rename to Sources/TranslateKitNavigation/Localizable.xcstrings diff --git a/Sources/TranslateKitNavigationLite/TK+Action.swift b/Sources/TranslateKitNavigation/TK+Action.swift similarity index 99% rename from Sources/TranslateKitNavigationLite/TK+Action.swift rename to Sources/TranslateKitNavigation/TK+Action.swift index c34717d..5635edd 100644 --- a/Sources/TranslateKitNavigationLite/TK+Action.swift +++ b/Sources/TranslateKitNavigation/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Navigate" - Use for starting navigation to a destination diff --git a/Sources/TranslateKitNavigationLite/TK+Label.swift b/Sources/TranslateKitNavigation/TK+Label.swift similarity index 99% rename from Sources/TranslateKitNavigationLite/TK+Label.swift rename to Sources/TranslateKitNavigation/TK+Label.swift index 41d394d..1a325ef 100644 --- a/Sources/TranslateKitNavigationLite/TK+Label.swift +++ b/Sources/TranslateKitNavigation/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Route" - Use for referring to the navigation route diff --git a/Sources/TranslateKitNavigationLite/TK+Message.swift b/Sources/TranslateKitNavigation/TK+Message.swift similarity index 99% rename from Sources/TranslateKitNavigationLite/TK+Message.swift rename to Sources/TranslateKitNavigation/TK+Message.swift index e441732..9cd872f 100644 --- a/Sources/TranslateKitNavigationLite/TK+Message.swift +++ b/Sources/TranslateKitNavigation/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Route calculation completed." - Message indicating that route calculation is complete diff --git a/Sources/TranslateKitNavigationLite/TK+Placeholder.swift b/Sources/TranslateKitNavigation/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitNavigationLite/TK+Placeholder.swift rename to Sources/TranslateKitNavigation/TK+Placeholder.swift index 94e2370..4ec856f 100644 --- a/Sources/TranslateKitNavigationLite/TK+Placeholder.swift +++ b/Sources/TranslateKitNavigation/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Enter destination…" - Placeholder for entering a destination diff --git a/Sources/TranslateKitNews/Exports.swift b/Sources/TranslateKitNews/Exports.swift deleted file mode 100644 index c780ac5..0000000 --- a/Sources/TranslateKitNews/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitNewsLite diff --git a/Sources/TranslateKitNewsLite/Localizable.xcstrings b/Sources/TranslateKitNews/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitNewsLite/Localizable.xcstrings rename to Sources/TranslateKitNews/Localizable.xcstrings diff --git a/Sources/TranslateKitNewsLite/TK+Action.swift b/Sources/TranslateKitNews/TK+Action.swift similarity index 99% rename from Sources/TranslateKitNewsLite/TK+Action.swift rename to Sources/TranslateKitNews/TK+Action.swift index 0db157c..246ae45 100644 --- a/Sources/TranslateKitNewsLite/TK+Action.swift +++ b/Sources/TranslateKitNews/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Archive" - Use for archiving an article or content diff --git a/Sources/TranslateKitNewsLite/TK+Label.swift b/Sources/TranslateKitNews/TK+Label.swift similarity index 99% rename from Sources/TranslateKitNewsLite/TK+Label.swift rename to Sources/TranslateKitNews/TK+Label.swift index 6fd9af0..eda4127 100644 --- a/Sources/TranslateKitNewsLite/TK+Label.swift +++ b/Sources/TranslateKitNews/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Article" - Use for labeling a single piece of content or article diff --git a/Sources/TranslateKitNewsLite/TK+Message.swift b/Sources/TranslateKitNews/TK+Message.swift similarity index 99% rename from Sources/TranslateKitNewsLite/TK+Message.swift rename to Sources/TranslateKitNews/TK+Message.swift index 6a588d3..d237cf0 100644 --- a/Sources/TranslateKitNewsLite/TK+Message.swift +++ b/Sources/TranslateKitNews/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Article added to your bookmarks" - Confirmation when an article is added to bookmarks diff --git a/Sources/TranslateKitNewsLite/TK+Placeholder.swift b/Sources/TranslateKitNews/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitNewsLite/TK+Placeholder.swift rename to Sources/TranslateKitNews/TK+Placeholder.swift index 2ee352d..88b62cb 100644 --- a/Sources/TranslateKitNewsLite/TK+Placeholder.swift +++ b/Sources/TranslateKitNews/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a comment…" - Placeholder for adding a comment to an article or post diff --git a/Sources/TranslateKitPhotoAndVideo/Exports.swift b/Sources/TranslateKitPhotoAndVideo/Exports.swift deleted file mode 100644 index 67b84fe..0000000 --- a/Sources/TranslateKitPhotoAndVideo/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitPhotoAndVideoLite diff --git a/Sources/TranslateKitPhotoAndVideoLite/Localizable.xcstrings b/Sources/TranslateKitPhotoAndVideo/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitPhotoAndVideoLite/Localizable.xcstrings rename to Sources/TranslateKitPhotoAndVideo/Localizable.xcstrings diff --git a/Sources/TranslateKitPhotoAndVideoLite/TK+Action.swift b/Sources/TranslateKitPhotoAndVideo/TK+Action.swift similarity index 99% rename from Sources/TranslateKitPhotoAndVideoLite/TK+Action.swift rename to Sources/TranslateKitPhotoAndVideo/TK+Action.swift index a21a184..231f41f 100644 --- a/Sources/TranslateKitPhotoAndVideoLite/TK+Action.swift +++ b/Sources/TranslateKitPhotoAndVideo/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Adjust" - Use for adjusting photo or video settings diff --git a/Sources/TranslateKitPhotoAndVideoLite/TK+Label.swift b/Sources/TranslateKitPhotoAndVideo/TK+Label.swift similarity index 99% rename from Sources/TranslateKitPhotoAndVideoLite/TK+Label.swift rename to Sources/TranslateKitPhotoAndVideo/TK+Label.swift index 390437a..3748429 100644 --- a/Sources/TranslateKitPhotoAndVideoLite/TK+Label.swift +++ b/Sources/TranslateKitPhotoAndVideo/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Albums" - Use for displaying photo albums diff --git a/Sources/TranslateKitPhotoAndVideoLite/TK+Message.swift b/Sources/TranslateKitPhotoAndVideo/TK+Message.swift similarity index 99% rename from Sources/TranslateKitPhotoAndVideoLite/TK+Message.swift rename to Sources/TranslateKitPhotoAndVideo/TK+Message.swift index 773f26e..9a5655d 100644 --- a/Sources/TranslateKitPhotoAndVideoLite/TK+Message.swift +++ b/Sources/TranslateKitPhotoAndVideo/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Access to your camera is required." - Message displayed when camera access is needed diff --git a/Sources/TranslateKitPhotoAndVideoLite/TK+Placeholder.swift b/Sources/TranslateKitPhotoAndVideo/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitPhotoAndVideoLite/TK+Placeholder.swift rename to Sources/TranslateKitPhotoAndVideo/TK+Placeholder.swift index 3226c6b..a9ed2ba 100644 --- a/Sources/TranslateKitPhotoAndVideoLite/TK+Placeholder.swift +++ b/Sources/TranslateKitPhotoAndVideo/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add caption..." - Placeholder for adding a caption to an image or video diff --git a/Sources/TranslateKitProductivity/Exports.swift b/Sources/TranslateKitProductivity/Exports.swift deleted file mode 100644 index 3cbe5a3..0000000 --- a/Sources/TranslateKitProductivity/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitProductivityLite diff --git a/Sources/TranslateKitProductivityLite/Localizable.xcstrings b/Sources/TranslateKitProductivity/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitProductivityLite/Localizable.xcstrings rename to Sources/TranslateKitProductivity/Localizable.xcstrings diff --git a/Sources/TranslateKitProductivityLite/TK+Action.swift b/Sources/TranslateKitProductivity/TK+Action.swift similarity index 99% rename from Sources/TranslateKitProductivityLite/TK+Action.swift rename to Sources/TranslateKitProductivity/TK+Action.swift index 0503e9e..ae068dc 100644 --- a/Sources/TranslateKitProductivityLite/TK+Action.swift +++ b/Sources/TranslateKitProductivity/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Archive" - Use for archiving content or tasks diff --git a/Sources/TranslateKitProductivityLite/TK+Label.swift b/Sources/TranslateKitProductivity/TK+Label.swift similarity index 99% rename from Sources/TranslateKitProductivityLite/TK+Label.swift rename to Sources/TranslateKitProductivity/TK+Label.swift index ca3e0b2..29117e6 100644 --- a/Sources/TranslateKitProductivityLite/TK+Label.swift +++ b/Sources/TranslateKitProductivity/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Assigned To" - Use when referring to the person responsible for a task diff --git a/Sources/TranslateKitProductivityLite/TK+Message.swift b/Sources/TranslateKitProductivity/TK+Message.swift similarity index 99% rename from Sources/TranslateKitProductivityLite/TK+Message.swift rename to Sources/TranslateKitProductivity/TK+Message.swift index b423978..d094d3e 100644 --- a/Sources/TranslateKitProductivityLite/TK+Message.swift +++ b/Sources/TranslateKitProductivity/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "All tasks completed!" - Message displayed when all tasks have been completed diff --git a/Sources/TranslateKitProductivityLite/TK+Placeholder.swift b/Sources/TranslateKitProductivity/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitProductivityLite/TK+Placeholder.swift rename to Sources/TranslateKitProductivity/TK+Placeholder.swift index ccd4908..c3bf3eb 100644 --- a/Sources/TranslateKitProductivityLite/TK+Placeholder.swift +++ b/Sources/TranslateKitProductivity/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a description…" - Placeholder text for adding a description to a task or project diff --git a/Sources/TranslateKitReference/Exports.swift b/Sources/TranslateKitReference/Exports.swift deleted file mode 100644 index c6a20a6..0000000 --- a/Sources/TranslateKitReference/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitReferenceLite diff --git a/Sources/TranslateKitReferenceLite/Localizable.xcstrings b/Sources/TranslateKitReference/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitReferenceLite/Localizable.xcstrings rename to Sources/TranslateKitReference/Localizable.xcstrings diff --git a/Sources/TranslateKitReferenceLite/TK+Action.swift b/Sources/TranslateKitReference/TK+Action.swift similarity index 99% rename from Sources/TranslateKitReferenceLite/TK+Action.swift rename to Sources/TranslateKitReference/TK+Action.swift index 6c4c3b2..5108564 100644 --- a/Sources/TranslateKitReferenceLite/TK+Action.swift +++ b/Sources/TranslateKitReference/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Add Note" - Use when adding a new note or annotation diff --git a/Sources/TranslateKitReferenceLite/TK+Label.swift b/Sources/TranslateKitReference/TK+Label.swift similarity index 99% rename from Sources/TranslateKitReferenceLite/TK+Label.swift rename to Sources/TranslateKitReference/TK+Label.swift index f2c5a11..8b91c9a 100644 --- a/Sources/TranslateKitReferenceLite/TK+Label.swift +++ b/Sources/TranslateKitReference/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Abbreviation" - Use when referring to an abbreviation or shortened form of a word or phrase diff --git a/Sources/TranslateKitReferenceLite/TK+Message.swift b/Sources/TranslateKitReference/TK+Message.swift similarity index 99% rename from Sources/TranslateKitReferenceLite/TK+Message.swift rename to Sources/TranslateKitReference/TK+Message.swift index 3c53e5e..3161c74 100644 --- a/Sources/TranslateKitReferenceLite/TK+Message.swift +++ b/Sources/TranslateKitReference/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Add to favorites for quick access later." - Confirmation when adding an item to favorites diff --git a/Sources/TranslateKitReferenceLite/TK+Placeholder.swift b/Sources/TranslateKitReference/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitReferenceLite/TK+Placeholder.swift rename to Sources/TranslateKitReference/TK+Placeholder.swift index 03a3592..589e974 100644 --- a/Sources/TranslateKitReferenceLite/TK+Placeholder.swift +++ b/Sources/TranslateKitReference/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a note…" - Placeholder for adding a new note diff --git a/Sources/TranslateKitShopping/Exports.swift b/Sources/TranslateKitShopping/Exports.swift deleted file mode 100644 index 0bed5f2..0000000 --- a/Sources/TranslateKitShopping/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitShoppingLite diff --git a/Sources/TranslateKitShoppingLite/Localizable.xcstrings b/Sources/TranslateKitShopping/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitShoppingLite/Localizable.xcstrings rename to Sources/TranslateKitShopping/Localizable.xcstrings diff --git a/Sources/TranslateKitShoppingLite/TK+Action.swift b/Sources/TranslateKitShopping/TK+Action.swift similarity index 99% rename from Sources/TranslateKitShoppingLite/TK+Action.swift rename to Sources/TranslateKitShopping/TK+Action.swift index 4c5508f..7e34b20 100644 --- a/Sources/TranslateKitShoppingLite/TK+Action.swift +++ b/Sources/TranslateKitShopping/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Add to Cart" - Use when adding an item to the shopping cart diff --git a/Sources/TranslateKitShoppingLite/TK+Label.swift b/Sources/TranslateKitShopping/TK+Label.swift similarity index 99% rename from Sources/TranslateKitShoppingLite/TK+Label.swift rename to Sources/TranslateKitShopping/TK+Label.swift index 969890b..a95aeda 100644 --- a/Sources/TranslateKitShoppingLite/TK+Label.swift +++ b/Sources/TranslateKitShopping/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Announcement" - Use for special announcements or updates diff --git a/Sources/TranslateKitShoppingLite/TK+Message.swift b/Sources/TranslateKitShopping/TK+Message.swift similarity index 99% rename from Sources/TranslateKitShoppingLite/TK+Message.swift rename to Sources/TranslateKitShopping/TK+Message.swift index d436d6d..aa4b63c 100644 --- a/Sources/TranslateKitShoppingLite/TK+Message.swift +++ b/Sources/TranslateKitShopping/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Added to cart successfully." - Confirmation when an item has been added to the cart diff --git a/Sources/TranslateKitShoppingLite/TK+Placeholder.swift b/Sources/TranslateKitShopping/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitShoppingLite/TK+Placeholder.swift rename to Sources/TranslateKitShopping/TK+Placeholder.swift index 3a8b553..09dcea0 100644 --- a/Sources/TranslateKitShoppingLite/TK+Placeholder.swift +++ b/Sources/TranslateKitShopping/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a delivery note…" - Placeholder for entering special delivery instructions diff --git a/Sources/TranslateKitSocialNetworking/Exports.swift b/Sources/TranslateKitSocialNetworking/Exports.swift deleted file mode 100644 index ac5c1a5..0000000 --- a/Sources/TranslateKitSocialNetworking/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitSocialNetworkingLite diff --git a/Sources/TranslateKitSocialNetworkingLite/Localizable.xcstrings b/Sources/TranslateKitSocialNetworking/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitSocialNetworkingLite/Localizable.xcstrings rename to Sources/TranslateKitSocialNetworking/Localizable.xcstrings diff --git a/Sources/TranslateKitSocialNetworkingLite/TK+Action.swift b/Sources/TranslateKitSocialNetworking/TK+Action.swift similarity index 99% rename from Sources/TranslateKitSocialNetworkingLite/TK+Action.swift rename to Sources/TranslateKitSocialNetworking/TK+Action.swift index fde38cd..c3356c5 100644 --- a/Sources/TranslateKitSocialNetworkingLite/TK+Action.swift +++ b/Sources/TranslateKitSocialNetworking/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Follow" - Use when subscribing to updates from a user or content diff --git a/Sources/TranslateKitSocialNetworkingLite/TK+Label.swift b/Sources/TranslateKitSocialNetworking/TK+Label.swift similarity index 99% rename from Sources/TranslateKitSocialNetworkingLite/TK+Label.swift rename to Sources/TranslateKitSocialNetworking/TK+Label.swift index e322387..d5267f2 100644 --- a/Sources/TranslateKitSocialNetworkingLite/TK+Label.swift +++ b/Sources/TranslateKitSocialNetworking/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Followers" - Use for a list of users following the account diff --git a/Sources/TranslateKitSocialNetworkingLite/TK+Message.swift b/Sources/TranslateKitSocialNetworking/TK+Message.swift similarity index 99% rename from Sources/TranslateKitSocialNetworkingLite/TK+Message.swift rename to Sources/TranslateKitSocialNetworking/TK+Message.swift index 686d321..4c8367e 100644 --- a/Sources/TranslateKitSocialNetworkingLite/TK+Message.swift +++ b/Sources/TranslateKitSocialNetworking/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Account has been blocked." - Notification when an account is blocked diff --git a/Sources/TranslateKitSocialNetworkingLite/TK+Placeholder.swift b/Sources/TranslateKitSocialNetworking/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitSocialNetworkingLite/TK+Placeholder.swift rename to Sources/TranslateKitSocialNetworking/TK+Placeholder.swift index d896c43..f9caeb1 100644 --- a/Sources/TranslateKitSocialNetworkingLite/TK+Placeholder.swift +++ b/Sources/TranslateKitSocialNetworking/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Write a post…" - Placeholder for writing a new post or status diff --git a/Sources/TranslateKitSports/Exports.swift b/Sources/TranslateKitSports/Exports.swift deleted file mode 100644 index 7911d1f..0000000 --- a/Sources/TranslateKitSports/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitSportsLite diff --git a/Sources/TranslateKitSportsLite/Localizable.xcstrings b/Sources/TranslateKitSports/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitSportsLite/Localizable.xcstrings rename to Sources/TranslateKitSports/Localizable.xcstrings diff --git a/Sources/TranslateKitSportsLite/TK+Action.swift b/Sources/TranslateKitSports/TK+Action.swift similarity index 99% rename from Sources/TranslateKitSportsLite/TK+Action.swift rename to Sources/TranslateKitSports/TK+Action.swift index 82b8097..efae601 100644 --- a/Sources/TranslateKitSportsLite/TK+Action.swift +++ b/Sources/TranslateKitSports/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Join Team" - Use for joining a sports team diff --git a/Sources/TranslateKitSportsLite/TK+Label.swift b/Sources/TranslateKitSports/TK+Label.swift similarity index 99% rename from Sources/TranslateKitSportsLite/TK+Label.swift rename to Sources/TranslateKitSports/TK+Label.swift index 71c3bfb..8e0179d 100644 --- a/Sources/TranslateKitSportsLite/TK+Label.swift +++ b/Sources/TranslateKitSports/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Score" - Use for displaying the score in a game or match diff --git a/Sources/TranslateKitSportsLite/TK+Message.swift b/Sources/TranslateKitSports/TK+Message.swift similarity index 99% rename from Sources/TranslateKitSportsLite/TK+Message.swift rename to Sources/TranslateKitSports/TK+Message.swift index 220b8ac..6887105 100644 --- a/Sources/TranslateKitSportsLite/TK+Message.swift +++ b/Sources/TranslateKitSports/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Game starting soon" - Notification for an upcoming game diff --git a/Sources/TranslateKitSportsLite/TK+Placeholder.swift b/Sources/TranslateKitSports/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitSportsLite/TK+Placeholder.swift rename to Sources/TranslateKitSports/TK+Placeholder.swift index 5eb7d6e..c667d6b 100644 --- a/Sources/TranslateKitSportsLite/TK+Placeholder.swift +++ b/Sources/TranslateKitSports/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Enter team name…" - Placeholder for entering a sports team name diff --git a/Sources/TranslateKitStickers/Exports.swift b/Sources/TranslateKitStickers/Exports.swift deleted file mode 100644 index 6646fcf..0000000 --- a/Sources/TranslateKitStickers/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitStickersLite diff --git a/Sources/TranslateKitStickersLite/Localizable.xcstrings b/Sources/TranslateKitStickers/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitStickersLite/Localizable.xcstrings rename to Sources/TranslateKitStickers/Localizable.xcstrings diff --git a/Sources/TranslateKitStickersLite/TK+Action.swift b/Sources/TranslateKitStickers/TK+Action.swift similarity index 99% rename from Sources/TranslateKitStickersLite/TK+Action.swift rename to Sources/TranslateKitStickers/TK+Action.swift index c901bb5..b9d9b5a 100644 --- a/Sources/TranslateKitStickersLite/TK+Action.swift +++ b/Sources/TranslateKitStickers/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Preview Sticker" - Use when previewing a sticker diff --git a/Sources/TranslateKitStickersLite/TK+Label.swift b/Sources/TranslateKitStickers/TK+Label.swift similarity index 99% rename from Sources/TranslateKitStickersLite/TK+Label.swift rename to Sources/TranslateKitStickers/TK+Label.swift index 97d1060..8f5e1da 100644 --- a/Sources/TranslateKitStickersLite/TK+Label.swift +++ b/Sources/TranslateKitStickers/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Collection" - Use for referring to a collection of stickers diff --git a/Sources/TranslateKitStickersLite/TK+Message.swift b/Sources/TranslateKitStickers/TK+Message.swift similarity index 99% rename from Sources/TranslateKitStickersLite/TK+Message.swift rename to Sources/TranslateKitStickers/TK+Message.swift index b0612c4..573fa11 100644 --- a/Sources/TranslateKitStickersLite/TK+Message.swift +++ b/Sources/TranslateKitStickers/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Sticker added to favorites!" - Confirmation when a sticker is added to favorites diff --git a/Sources/TranslateKitStickersLite/TK+Placeholder.swift b/Sources/TranslateKitStickers/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitStickersLite/TK+Placeholder.swift rename to Sources/TranslateKitStickers/TK+Placeholder.swift index 470cdb8..605198b 100644 --- a/Sources/TranslateKitStickersLite/TK+Placeholder.swift +++ b/Sources/TranslateKitStickers/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Removing background…" - Placeholder while removing the background from a sticker diff --git a/Sources/TranslateKitTravel/Exports.swift b/Sources/TranslateKitTravel/Exports.swift deleted file mode 100644 index 0bb4d79..0000000 --- a/Sources/TranslateKitTravel/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitTravelLite diff --git a/Sources/TranslateKitTravelLite/Localizable.xcstrings b/Sources/TranslateKitTravel/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitTravelLite/Localizable.xcstrings rename to Sources/TranslateKitTravel/Localizable.xcstrings diff --git a/Sources/TranslateKitTravelLite/TK+Action.swift b/Sources/TranslateKitTravel/TK+Action.swift similarity index 99% rename from Sources/TranslateKitTravelLite/TK+Action.swift rename to Sources/TranslateKitTravel/TK+Action.swift index 59ac326..9f25ad1 100644 --- a/Sources/TranslateKitTravelLite/TK+Action.swift +++ b/Sources/TranslateKitTravel/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Book" - Use for making a reservation or booking diff --git a/Sources/TranslateKitTravelLite/TK+Label.swift b/Sources/TranslateKitTravel/TK+Label.swift similarity index 99% rename from Sources/TranslateKitTravelLite/TK+Label.swift rename to Sources/TranslateKitTravel/TK+Label.swift index 5988021..b05dff3 100644 --- a/Sources/TranslateKitTravelLite/TK+Label.swift +++ b/Sources/TranslateKitTravel/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Accommodation" - Use for referring to places where one can stay (e.g., hotels, hostels) diff --git a/Sources/TranslateKitTravelLite/TK+Message.swift b/Sources/TranslateKitTravel/TK+Message.swift similarity index 99% rename from Sources/TranslateKitTravelLite/TK+Message.swift rename to Sources/TranslateKitTravel/TK+Message.swift index fc792ce..baf80f3 100644 --- a/Sources/TranslateKitTravelLite/TK+Message.swift +++ b/Sources/TranslateKitTravel/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Boarding pass added successfully." - Message indicating the boarding pass was successfully added diff --git a/Sources/TranslateKitTravelLite/TK+Placeholder.swift b/Sources/TranslateKitTravel/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitTravelLite/TK+Placeholder.swift rename to Sources/TranslateKitTravel/TK+Placeholder.swift index d6f0bde..6afee44 100644 --- a/Sources/TranslateKitTravelLite/TK+Placeholder.swift +++ b/Sources/TranslateKitTravel/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Add a delivery note…" - Placeholder for adding a delivery note diff --git a/Sources/TranslateKitUtilities/Exports.swift b/Sources/TranslateKitUtilities/Exports.swift deleted file mode 100644 index dc94a08..0000000 --- a/Sources/TranslateKitUtilities/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitUtilitiesLite diff --git a/Sources/TranslateKitUtilitiesLite/Localizable.xcstrings b/Sources/TranslateKitUtilities/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitUtilitiesLite/Localizable.xcstrings rename to Sources/TranslateKitUtilities/Localizable.xcstrings diff --git a/Sources/TranslateKitUtilitiesLite/TK+Action.swift b/Sources/TranslateKitUtilities/TK+Action.swift similarity index 99% rename from Sources/TranslateKitUtilitiesLite/TK+Action.swift rename to Sources/TranslateKitUtilities/TK+Action.swift index daabbd9..0634d1b 100644 --- a/Sources/TranslateKitUtilitiesLite/TK+Action.swift +++ b/Sources/TranslateKitUtilities/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Archive" - Use for archiving data or files diff --git a/Sources/TranslateKitUtilitiesLite/TK+Label.swift b/Sources/TranslateKitUtilities/TK+Label.swift similarity index 99% rename from Sources/TranslateKitUtilitiesLite/TK+Label.swift rename to Sources/TranslateKitUtilities/TK+Label.swift index daa7757..670ed03 100644 --- a/Sources/TranslateKitUtilitiesLite/TK+Label.swift +++ b/Sources/TranslateKitUtilities/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "API Key" - Use for labeling an API key for authentication or access diff --git a/Sources/TranslateKitUtilitiesLite/TK+Message.swift b/Sources/TranslateKitUtilities/TK+Message.swift similarity index 99% rename from Sources/TranslateKitUtilitiesLite/TK+Message.swift rename to Sources/TranslateKitUtilities/TK+Message.swift index aa4c81a..b94f670 100644 --- a/Sources/TranslateKitUtilitiesLite/TK+Message.swift +++ b/Sources/TranslateKitUtilities/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Backup completed successfully" - Confirmation when a backup has been completed successfully diff --git a/Sources/TranslateKitUtilitiesLite/TK+Placeholder.swift b/Sources/TranslateKitUtilities/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitUtilitiesLite/TK+Placeholder.swift rename to Sources/TranslateKitUtilities/TK+Placeholder.swift index e6d7b15..2b8aef1 100644 --- a/Sources/TranslateKitUtilitiesLite/TK+Placeholder.swift +++ b/Sources/TranslateKitUtilities/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Analyzing network speed…" - Placeholder when analyzing network speed diff --git a/Sources/TranslateKitWeather/Exports.swift b/Sources/TranslateKitWeather/Exports.swift deleted file mode 100644 index 7b6a100..0000000 --- a/Sources/TranslateKitWeather/Exports.swift +++ /dev/null @@ -1,2 +0,0 @@ -@_exported import TranslateKit -@_exported import TranslateKitWeatherLite diff --git a/Sources/TranslateKitWeatherLite/Localizable.xcstrings b/Sources/TranslateKitWeather/Localizable.xcstrings similarity index 100% rename from Sources/TranslateKitWeatherLite/Localizable.xcstrings rename to Sources/TranslateKitWeather/Localizable.xcstrings diff --git a/Sources/TranslateKitWeatherLite/TK+Action.swift b/Sources/TranslateKitWeather/TK+Action.swift similarity index 99% rename from Sources/TranslateKitWeatherLite/TK+Action.swift rename to Sources/TranslateKitWeather/TK+Action.swift index 613d80d..2bc7230 100644 --- a/Sources/TranslateKitWeatherLite/TK+Action.swift +++ b/Sources/TranslateKitWeather/TK+Action.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Action { /// "Calibrate" - Use for calibrating weather-related measurements or devices diff --git a/Sources/TranslateKitWeatherLite/TK+Label.swift b/Sources/TranslateKitWeather/TK+Label.swift similarity index 99% rename from Sources/TranslateKitWeatherLite/TK+Label.swift rename to Sources/TranslateKitWeather/TK+Label.swift index f161af0..ea7df70 100644 --- a/Sources/TranslateKitWeatherLite/TK+Label.swift +++ b/Sources/TranslateKitWeather/TK+Label.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Label { /// "Air Pressure" - Use for displaying the air pressure measurement diff --git a/Sources/TranslateKitWeatherLite/TK+Message.swift b/Sources/TranslateKitWeather/TK+Message.swift similarity index 99% rename from Sources/TranslateKitWeatherLite/TK+Message.swift rename to Sources/TranslateKitWeather/TK+Message.swift index ed87000..de3fb1f 100644 --- a/Sources/TranslateKitWeatherLite/TK+Message.swift +++ b/Sources/TranslateKitWeather/TK+Message.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Message { /// "Air quality is unhealthy today." - Message indicating poor air quality diff --git a/Sources/TranslateKitWeatherLite/TK+Placeholder.swift b/Sources/TranslateKitWeather/TK+Placeholder.swift similarity index 99% rename from Sources/TranslateKitWeatherLite/TK+Placeholder.swift rename to Sources/TranslateKitWeather/TK+Placeholder.swift index 94e82f2..9b50ab8 100644 --- a/Sources/TranslateKitWeatherLite/TK+Placeholder.swift +++ b/Sources/TranslateKitWeather/TK+Placeholder.swift @@ -1,5 +1,5 @@ import Foundation -@_exported import TranslateKitLite +@_exported import TranslateKit extension TK.Placeholder { /// "Analyzing weather data…" - Placeholder when analyzing weather data diff --git a/Tests/TranslateKitTests/StringExtTests.swift b/Tests/TranslateKitTests/StringExtTests.swift deleted file mode 100644 index 365f3fa..0000000 --- a/Tests/TranslateKitTests/StringExtTests.swift +++ /dev/null @@ -1,33 +0,0 @@ -import Testing - -@testable import TranslateKitMacros - -@Test func variousVariantsOfToUpperCamelCase() { - #expect("".toUpperCamelCase() == "") - #expect(" \t ".toUpperCamelCase() == "") - #expect("displayName".toUpperCamelCase() == "DisplayName") - #expect("body".toUpperCamelCase() == "Body") - #expect("RESTClient".toUpperCamelCase() == "RESTClient") - #expect("commonAPIGuidelines".toUpperCamelCase() == "CommonAPIGuidelines") - #expect("Chris Lattner: 'Let's make Swift #1!'".toUpperCamelCase() == "ChrisLattnerLetsMakeSwift1") - #expect("Error: Request failed. Please try again!".toUpperCamelCase() == "ErrorRequestFailedPleaseTryAgain") - #expect("Don't even try to escape! It's impossible, trust me. I've tried.".toUpperCamelCase() == "DontEvenTryToEscapeItsImpossibleTrustMeIveTried") - #expect("\"Always\", said Snape. Those were his last words.".toUpperCamelCase() == "AlwaysSaidSnapeThoseWereHisLastWords") - #expect("Cihat Gündüz".toUpperCamelCase() == "CihatGunduz") - #expect("4 times 4 is 16, and the 2nd number is 6.".toUpperCamelCase() == "4Times4Is16AndThe2ndNumberIs6") -} - -@Test func variousVariantsOfToLowerCamelCase() { - #expect("".toLowerCamelCase(maxWords: 3) == "") - #expect(" \t ".toLowerCamelCase(maxWords: 3) == "") - #expect("displayName".toLowerCamelCase(maxWords: 3) == "displayName") - #expect("body".toLowerCamelCase(maxWords: 3) == "body") - #expect("RESTClient".toLowerCamelCase(maxWords: 3) == "restClient") - #expect("commonAPIGuidelines".toLowerCamelCase(maxWords: 2) == "commonAPI…") - #expect("Chris Lattner: 'Let's make Swift #1!'".toLowerCamelCase(maxWords: 6) == "chrisLattnerLetsMakeSwift1") - #expect("Error: Request failed. Please try again!".toLowerCamelCase(maxWords: 6) == "errorRequestFailedPleaseTryAgain") - #expect("Don't even try to escape! It's impossible, trust me. I've tried.".toLowerCamelCase(maxWords: 7) == "dontEvenTryToEscapeItsImpossible…") - #expect("\"Always\", said Snape. Those were his last words.".toLowerCamelCase(maxWords: 6) == "alwaysSaidSnapeThoseWereHis…") - #expect("Cihat Gündüz".toLowerCamelCase(maxWords: 6) == "cihatGunduz") - #expect("4 times 4 is 16, and the 2nd number is 6.".toUpperCamelCase() == "4Times4Is16AndThe2ndNumberIs6") -} diff --git a/Tests/TranslateKitTests/TranslateKitTests.swift b/Tests/TranslateKitTests/TranslateKitTests.swift new file mode 100644 index 0000000..e3fac6f --- /dev/null +++ b/Tests/TranslateKitTests/TranslateKitTests.swift @@ -0,0 +1,58 @@ +import Foundation +import Testing + +import TranslateKit +import TranslateKitFinance + +/// Verifies that the packages load and that their String Catalogs resolve in more than one language. +@Suite("TranslateKit") +struct TranslateKitTests { + /// Locates the compiled resource bundle SwiftPM places next to the test bundle for the given target. + private func resourceBundle(for target: String) throws -> Bundle { + let bundleName = "TranslateKit_\(target).bundle" + let searchDirectories = ([Bundle(for: BundleToken.self)] + Bundle.allBundles + [Bundle.main]).map { $0.bundleURL.deletingLastPathComponent() } + + for directory in searchDirectories { + let url = directory.appendingPathComponent(bundleName) + if let bundle = Bundle(url: url) { return bundle } + } + throw ResourceBundleNotFound(name: bundleName) + } + + private func localizedString(_ key: String, in bundle: Bundle, language: String) throws -> String { + let path = try #require(bundle.path(forResource: language, ofType: "lproj"), "Missing \(language).lproj in \(bundle.bundleURL.lastPathComponent)") + let languageBundle = try #require(Bundle(path: path)) + return languageBundle.localizedString(forKey: key, value: "__missing__", table: nil) + } + + @Test func coreStringsAreAvailableAsStaticProperties() { + #expect(TK.Action.save == "Save") + #expect(TK.Action.cancel == "Cancel") + #expect(!TK.Label.notifications.isEmpty) + #expect(!TK.Placeholder.firstNameExample.isEmpty) + #expect(!TK.Message.anErrorOccurred.isEmpty) + } + + @Test func categoryStringsAreAvailableAlongsideCoreStrings() { + #expect(TK.Action.addAccount == "Add Account") + #expect(TK.Action.save == "Save") // core strings are re-exported by the category module + } + + @Test func coreStringsResolveInEnglishAndGerman() throws { + let bundle = try resourceBundle(for: "TranslateKit") + #expect(try localizedString("TK.Action.save", in: bundle, language: "en") == "Save") + #expect(try localizedString("TK.Action.save", in: bundle, language: "de") == "Sichern") + } + + @Test func categoryStringsResolveInEnglishAndGerman() throws { + let bundle = try resourceBundle(for: "TranslateKitFinance") + let english = try localizedString("TK.Action.addAccount", in: bundle, language: "en") + let german = try localizedString("TK.Action.addAccount", in: bundle, language: "de") + #expect(english == "Add Account") + #expect(german != "__missing__" && german != english) + } +} + +private struct ResourceBundleNotFound: Error { let name: String } + +private final class BundleToken {} diff --git a/Tests/TranslateKitTests/TranslationKeyModuleTests.swift b/Tests/TranslateKitTests/TranslationKeyModuleTests.swift deleted file mode 100644 index 0781ce2..0000000 --- a/Tests/TranslateKitTests/TranslationKeyModuleTests.swift +++ /dev/null @@ -1,120 +0,0 @@ -import MacroTesting -import SwiftSyntaxMacrosTestSupport -import Testing -import TranslateKitMacros - -@testable import TranslateKit - -@Test -func tkmSimpleViewButtonExpansion() { - assertMacro(["tkm": TranslationKeyModule.self]) { - """ - import SwiftUI - - extension MyNamespace { - struct MyView: View { - var body: some View { - Button(#tkm("Save Changes")) { - self.handleSave() - } - } - } - } - """ - } expansion: { - """ - import SwiftUI - - extension MyNamespace { - struct MyView: View { - var body: some View { - Button(String(localized: "MyNamespace.MyView.Body.saveChanges", defaultValue: "Save Changes", bundle: Bundle.module)) { - self.handleSave() - } - } - } - } - """ - } -} - -@Test -func tkmSimpleEnumPropertyExpansion() { - assertMacro(["tkm": TranslationKeyModule.self]) { - """ - enum MyModel: String, CaseIterable, Codable { - case movie - case series - - var displayName: String { - switch self { - case .movie: #tkm("Movie") - case .series: #tkm("TV Show", c: "Name for TV series content type") - } - } - } - """ - } expansion: { - """ - enum MyModel: String, CaseIterable, Codable { - case movie - case series - - var displayName: String { - switch self { - case .movie: String(localized: "MyModel.DisplayName.movie", defaultValue: "Movie", bundle: Bundle.module) - case .series: String(localized: "MyModel.DisplayName.tvShow", defaultValue: "TV Show", bundle: Bundle.module, comment: "Name for TV series content type") - } - } - } - """ - } -} - -@Test -func tkmLoadingVariantsExpansion() { - assertMacro(["tkm": TranslationKeyModule.self]) { - """ - extension TK { - public enum Placeholder { - public static var loading: String { #tkm("Loading") } - public static var loadingDots: String { #tkm("Loading…") } - public static var loadingUPPERCASE: String { #tkm("LOADING") } - } - } - """ - } expansion: { - """ - extension TK { - public enum Placeholder { - public static var loading: String { String(localized: "TK.Placeholder.Loading.loading", defaultValue: "Loading", bundle: Bundle.module) } - public static var loadingDots: String { String(localized: "TK.Placeholder.LoadingDots.loadingDots", defaultValue: "Loading…", bundle: Bundle.module) } - public static var loadingUPPERCASE: String { String(localized: "TK.Placeholder.LoadingUPPERCASE.LOADING", defaultValue: "LOADING", bundle: Bundle.module) } - } - } - """ - } -} - -@Test -func tkmExtensionExpansion() { - assertMacro(["tkm": TranslationKeyModule.self]) { - """ - extension TK.Action { - /// "Scan" - Use for scanning documents, files, or devices - public static var scan: String { - #tkm("Scan", c: "Use for scanning documents, files, or devices") - } - } - """ - } expansion: { - """ - extension TK.Action { - /// "Scan" - Use for scanning documents, files, or devices - public static var scan: String { - String(localized: "TK.Action.Scan.scan", defaultValue: "Scan", bundle: Bundle.module, comment: "Use for scanning documents, files, or devices") - } - } - """ - } -} diff --git a/Tests/TranslateKitTests/TranslationKeyTests.swift b/Tests/TranslateKitTests/TranslationKeyTests.swift deleted file mode 100644 index 1585400..0000000 --- a/Tests/TranslateKitTests/TranslationKeyTests.swift +++ /dev/null @@ -1,95 +0,0 @@ -import MacroTesting -import SwiftSyntaxMacrosTestSupport -import Testing -import TranslateKitMacros - -@testable import TranslateKit - -// TODO: report inconsistency between unit test results & actual behavior in CommonTranslations / in apps - -@Test -func simpleViewButtonExpansion() { - assertMacro(["tk": TranslationKey.self]) { - """ - import SwiftUI - - extension MyNamespace { - struct MyView: View { - var body: some View { - Button(#tk("Save Changes")) { - self.handleSave() - } - } - } - } - """ - } expansion: { - """ - import SwiftUI - - extension MyNamespace { - struct MyView: View { - var body: some View { - Button(String(localized: "MyNamespace.MyView.Body.saveChanges", defaultValue: "Save Changes")) { - self.handleSave() - } - } - } - } - """ - } -} - -@Test -func simpleEnumPropertyExpansion() { - assertMacro(["tk": TranslationKey.self]) { - """ - enum MyModel: String, CaseIterable, Codable { - case movie - case series - - var displayName: String { - switch self { - case .movie: #tk("Movie") - case .series: #tk("TV Show") - } - } - } - """ - } expansion: { - """ - enum MyModel: String, CaseIterable, Codable { - case movie - case series - - var displayName: String { - switch self { - case .movie: String(localized: "MyModel.DisplayName.movie", defaultValue: "Movie") - case .series: String(localized: "MyModel.DisplayName.tvShow", defaultValue: "TV Show") - } - } - } - """ - } -} - -@Test -func expansionWithComment() { - assertMacro(["tk": TranslationKey.self]) { - """ - struct ContentView { - var subtitle: String { - #tk("Start your journey", c: "Main onboarding screen subtitle") - } - } - """ - } expansion: { - """ - struct ContentView { - var subtitle: String { - String(localized: "ContentView.Subtitle.startYourJourney", defaultValue: "Start your journey", comment: "Main onboarding screen subtitle") - } - } - """ - } -}