Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build error after I localized Info.plist

I localized Info.plist :

enter image description here

And I got this build error :

error: could not read data from '/Users/cherif/Apps/Wesh/Info.plist':  The file “Info.plist” couldn’t be opened because there is no such file. 

Actually there are now two Info.plist files :

fr.lproj/Info.plist Base.lproj/Info.plist 

How to localize the Info.plist path ?

like image 355
Cherif Avatar asked Jun 22 '15 10:06

Cherif


People also ask

How do I create an InfoPlist string?

You should use InfoPlist. strings file (keep both I & P capital) to localize values of Info. plist . To do this, go to File->New->File , choose Strings File under Resource tab of iOS , name it InfoPlist , and create.

What is info plist in Xcode?

Xcode supplies an information property list file when you create a project from a template, as described in Create a project. By default, Xcode names this file Info. plist and adds it to your project as a source file that you can edit. Xcode creates one information property list for each target in the project folder.


2 Answers

Roll back those changes, add a InfoPlist.strings file to your project, localize it and then add the needed keys to it. For example:

"CFBundleDisplayName" = "App display name"; "CFBundleName" = "App bundle name"; 
like image 107
ncerezo Avatar answered Oct 14 '22 07:10

ncerezo


To localized Info.plist :

  1. Find in the x-code the folder Resources (is placed in root)
  2. Select the folder Resources
  3. Then press the main menu File->New->File...
  4. Select in section "Resource" Strings File and press Next
  5. Then in Save As field write InfoPlist ONLY ("I" capital and "P" capital)
  6. Then press Create
  7. Then select the file InfoPlist.strings that created in Resources folder and press in the right menu the button "Localize"
  8. Then you Select the Project from the Project Navigator and select the The project from project list
  9. In the info tab at the bottom you can as many as language you want (There is in section Localizations)
  10. The language you can see in Resources Folder
  11. To localize the values ("key") from info.plist file you can open with a text editor and get all the keys you want to localize
  12. You write any key as the example in any InfoPlist.strings like the above example

"NSLocationAlwaysAndWhenInUseUsageDescription"="blabla";

"NSLocationAlwaysUsageDescription"="blabla2";

That's all work and you have localize your info.plist file!

like image 45
Costas Bakoulias Avatar answered Oct 14 '22 07:10

Costas Bakoulias