Greetings, traveler!
Modern iOS architectures often rely on modularization, and Swift Package Manager has become the preferred way to structure reusable components. Each module can include its own resources, including localized strings, images, and other assets. On paper, this allows every feature to be developed and shipped independently. In practice, however, localization inside Swift Packages doesn’t always behave as developers expect once these modules are integrated into an app.
One issue appears frequently: localized strings inside a Swift Package work during development, but the moment the package is used inside a real application, every string falls back to English. Even when the package is configured correctly, the localized .lproj folders are ignored at runtime. This behavior can be confusing if you expect localization to work automatically across bundle boundaries.
Why Localizations Inside Swift Packages Are Ignored
Swift Packages build into their own resource bundles, separate from the main app bundle. Even though .strings files are stored inside these bundles and accessed via Bundle.module, the system still relies on the host application to declare which localizations it supports.
If the main app does not explicitly list a language in its configuration, iOS treats that language as unsupported at the app level. As a result, the runtime falls back to the default development language, typically English, regardless of what is available in the package.
This is an expected behavior of Apple’s localization system, not a bug. Only the main bundle defines the application’s language capabilities.
The Required Fix: Declaring Localizations in the Main App
To make Swift Package localizations work consistently, the main application must declare every supported language in its Info.plist under the CFBundleLocalizations key. Once this list is present, the system correctly resolves localized strings from all resource bundles, including those generated from Swift Packages.
A minimal configuration might look like this:
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>fr</string>
</array>After adding this entry, the previously ignored .lproj folders inside the Swift Package bundles start working immediately.
Conclusion
Localizing Swift Packages is straightforward once you understand how the system resolves languages across bundles. Even if modules contain their own .lproj folders, the main application must explicitly declare all supported localizations. Adding CFBundleLocalizations to Info.plist resolves the fallback-to-English issue and ensures that localized resources from Swift Packages behave as intended.
