Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 466
Daniel Avatar asked Sep 18 '15 20:09

Daniel


2 Answers

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
like image 155
Daniel Avatar answered Nov 15 '22 20:11

Daniel


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.

like image 33
Brendan Molloy Avatar answered Nov 15 '22 21:11

Brendan Molloy