Use DEBUG build for localization exports (Use Compiler to Extract Swift Strings)?

In order to localize string interpolation inside SwiftUI Text Views, String(localized:) and AttributedString(localized:), the project or framework's build settings needs to have Use Compiler to Extract Swift Strings enabled (e.g. SWIFT_EMIT_LOC_STRINGS=YES).

However, while testing exports it appears that exporting localizations (Product > Export Localizations) are always done using a RELEASE build rather than a DEBUG build.

For us, this is problematic as release builds use certificates that are only used by the build system. Software or internationalization engineers trying to export localizations with Use Compiler to Extract Swift Strings enabled, will run into issues as the swift compiler step will fail.

Is there a way to make localization exports use a DEBUG build rather than a RELEASE build? Or alternatively ignore signing for localization exports?

  • Hi, could you file a feedback for us to take a look, please? This can be done via the Feedback Assistant app on beta macOS or iOS, or via feedbackassistant.apple.com

  • Thank you, I filed feedback: FB11934338

Add a Comment

Replies

  1. When exporting localizations from the UI via Product > Export Localizations... the configuration of the currently active scheme is used. You can change this in the scheme editor: Edit Scheme... > Run > Build Configuration and confirm that the correct configuration is being used in the build log below the target being built. When exporting localizations from the CLI, the default configuration is used.
  2. Code-signing is not enabled when building for localization export / import, so it's likely not an issue with certificates that are only used for Release builds

If I had to guess, there is a compilation error that's preventing the the build from succeeding. Keep in mind that when building for localization—all targets are built for all destinations.