mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Support for Strings Catalogs (Xcode 15) (#1421)
* Support for xcode 15 string catalogs * Add sample string catalog to Test Fixture and basic test to check that asset catalogs are added in the resources build phase * Restore unintended changes * Update Pull Request number for 'Support for Strings Catalogs' in changelog * Update fixture yml generator * Detect knownRegions based on locales in string catalogs
This commit is contained in:
@@ -455,6 +455,7 @@ class SourceGenerator {
|
||||
|
||||
let createIntermediateGroups = targetSource.createIntermediateGroups ?? project.options.createIntermediateGroups
|
||||
let nonLocalizedChildren = children.filter { $0.extension != "lproj" }
|
||||
let stringCatalogChildren = children.filter { $0.extension == "xcstrings" }
|
||||
|
||||
let directories = nonLocalizedChildren
|
||||
.filter {
|
||||
@@ -520,6 +521,15 @@ class SourceGenerator {
|
||||
}()
|
||||
|
||||
knownRegions.formUnion(localisedDirectories.map { $0.lastComponentWithoutExtension })
|
||||
|
||||
// XCode 15 - Detect known regions from locales present in string catalogs
|
||||
|
||||
let stringCatalogsLocales = stringCatalogChildren
|
||||
.compactMap { StringCatalog(from: $0) }
|
||||
.reduce(Set<String>(), { partialResult, stringCatalog in
|
||||
partialResult.union(stringCatalog.includedLocales)
|
||||
})
|
||||
knownRegions.formUnion(stringCatalogsLocales)
|
||||
|
||||
// create variant groups of the base localisation first
|
||||
var baseLocalisationVariantGroups: [PBXVariantGroup] = []
|
||||
|
||||
Reference in New Issue
Block a user