Daniel
Daniel

Reputation: 9040

Localize iOS framework strings + resources using Xcode 7

I have a Swift framework built using Xcode 7. All is working fine, and now I want to add internationalization/localization support.

I've reviewed the WWDC 2014 video "Localizing with Xcode 6" (https://developer.apple.com/videos/wwdc/2014/) which discusses localizing an app.

However, it looks like I can't "Use Base Internationalization" to localize my storyboards in my framework project. When I try to enable the "Use Base Internationalization" project setting, the pop-up dialog shows an empty list of resource files.

(Note that I can choose the "Export For Localization..." Xcode menu option to export strings that are defined with NSLocalizedString in code.)

Is there something different that is required for Framework projects to support internationalization of storyboard resources?

Upvotes: 9

Views: 5943

Answers (2)

Daniel
Daniel

Reputation: 9040

The solution I went with was to do the following:

  1. In the Xcode Project navigator, select a storyboard file
  2. In the File inspector panel (on right), click the "Localize..." button
  3. Go back to the Project Info, and click Use Base Internationalization
  4. In the dialog that pops up, click Finish

Upvotes: 8

Brendan Molloy
Brendan Molloy

Reputation: 2026

Have you added other languages to your project? You can't localize without having enabled other languages to localize into.

To do this, select your project in the left panel, choose the Info tab from the center menu, and under the Localizations, press the + button to add more languages to your project.

It should then show you a window asking you which files you wish to localize, and you should be fine from there.

Upvotes: 1

Related Questions