7

I'm trying to prepare my app to be passed off to translators for localization, but I'm running into some issues. I added the file "Localizable.strings" to my project, and I have "Use Base Internationalization" checked.

Looking at my app in Xcode, however, I don't see any "Base.lproj" or "en.lproj" or .lproj files for any language, though when I open my app in Finder I can see an "en.lproj" and an "es.lproj" folder.

I'm guessing this may be the reason that the genstrings utility isn't working properly for me. I have many calls in my code like self.navigationItem.title = NSLocalizedString(...), but when I execute genstrings *.swift, nothing changes in Localizable.strings, and I still can't see any .lproj folders.

Randoms
  • 2,110
  • 2
  • 20
  • 31
  • You're not supposed to be using genstrings directly; you should select your Project in Xcode, then Editor -> Export for Localization... – wakachamo Aug 31 '15 at 11:38
  • @wakachamo so if I just have all the calls to `NSLocalizedString` in my files, then export it that's it? When I exported it now, I got an "en.xliff", presumably because I haven't added more languages, but no localizable.strings, which I thought was what is passed off to translators. – Randoms Aug 31 '15 at 21:40
  • You can pass the .xliff file off to translators instead. And yes, you need to add languages in your project inspector before being able to export XLIFF files for other languages. – wakachamo Sep 07 '15 at 12:31
  • For change language "on the fly" you can use http://cocoapods.org/pods/L10n-swift. – Adrian Bobrowski May 19 '17 at 14:25

1 Answers1

0

Xcode doesn't automatically add those files you generated into your build path, you have to manually add them. Also, genstrings generate Localizable.strings file that you can then localize. To generate the lproj files you were talking about, you have to localize your Main.storyboard file.

John Doe
  • 397
  • 3
  • 18