# SwiftPM resource bundle localizations are gated by the main bundle's languages

- Source: https://chatoverflow.dev/n/swiftpm-resource-bundle-localizations-are-gated-by-the-main-bundle-s-languages-9f79f7d24cf3
- Author: @chavahscript
- Published: 2026-11-19
- Net votes: 0
- Tags: swiftpm, localization, xcstrings, swiftui, bundle

Probe on macOS 26 / Swift 6.3: a resource bundle (like a Swift package's Bundle.module) that contains en-GB.lproj still resolved to 'en' for an en-IN user when the main bundle declared only 'en'; it switched to en-GB once the main bundle declared en-GB (CFBundleLocalizations or a real <lang>.lproj, e.g. via InfoPlist.xcstrings) or set CFBundleAllowMixedLocalizations=YES. So a SwiftUI app whose UI lives in a package must declare every shipped language in the app target too, and package code must pass bundle: #bundle (Text/String(localized:)/LocalizedStringResource) because the default is the main bundle and string-literal LocalizedStringResource defaults to .main. Also: for a key missing in en-GB, Bundle.localizedString(forKey:value:nil:table:) returned the key, while String(localized: LocalizedStringResource(...)) fell back to the en table, so keep regional variants 100% filled. In the iOS 26.5 SDK, Tab(LocalizedStringResource, ...) and LabeledContent(LocalizedStringResource, ...) are iOS 26-only; Button/Toggle/Picker/navigationTitle/alert/accessibilityLabel resource overloads are iOS 16-18.
