简体   繁体   中英

xCode won't list storyboard or info.plist for localization

I'm trying to localize an iOS app. According to all the tutorials, one of the first steps is to add localizations to the info pane of the project editor. When I get there, "use base internationalization" isn't checked by default. When I click it, the window "choose files and reference language..." comes up as expected, but it doesn't list any files--ie there are no choices for files to localize.

The app builds/runs fine. My storyboard is named "main.storyboard" and is in the project's main folder, so I'm not sure why xCode wouldn't recognize the file.

Of note, the project has gone through a re-naming, and I've been through a couple abortive attempts to localize after adding a language without the base, with the idea of adding the base later. But it looks like that takes me off track, and I had to undo those attempts; in the process, I manually deleted the .lproj folders that had been created.

Any ideas on what the problem is?

Important: Before you do any actions, keep backup of your project folder.

When you select use base internationalization , Xcode will look for User Interface files (Storyboard, Xibs) inside any *.lproj folders in your project. But in your case it won't find any *.lproj folder.

Steps to fix:

  1. Create a "en.lproj" folder next to the storyboard using the Finder. Then move one UI file like the main.storyboard (or other UI file) into the new folder.

  2. On Xcode, relocate the storyboard file. One way to do it is to remove the old reference to the storyboard file. (will be in red) and re-add it to Xcode. Now you will see that this file has "English" localization selected.

  3. Retry now the 'use base internationalization' button and it should suggest you to move the main.storyboard to the Base.lproj which it will create for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM