Xcode cannot locate localized info.plist
Asked Answered
C

2

16

After adding a few Localizations:

enter image description here

and localized the (AppName)-info.plist file:

enter image description here

and checked Bundle Resources (also tried to remove Go-info.plist from the Copy Resources Bundle list:

enter image description here

and the file property:

enter image description here

Xcode (4.6.3) give an error:

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

It looks like Xcode ignores the localization folder in the path. It tried to find the info.plist as:

.../Go/Go/Go-Info.plist

instead of:

.../Go/Go/(Localization)/Go-Info.plist

How can I fix it?

Cabman answered 5/8, 2013 at 7:14 Comment(1)
I'm not sure you can localize an info.plist. If you want to localize your AppName you should localize the infoPlist.strings file and add those keys : "CFBundleDisplayName" = "AppName"; "CFBundleName" = "AppName";Selfrevealing
S
40

I think Info.plist can not be localized. If you want to localize your application Name, you should localize the InfoPlist.strings file and use those keys :

"CFBundleDisplayName" = "AppName";
"CFBundleName" = "AppName";
Selfrevealing answered 5/8, 2013 at 7:29 Comment(3)
Drop the double quote of key as it's a NSString value already, works good for me.Egocentric
Here's the Apple Doc for reference: developer.apple.com/library/ios/documentation/General/Reference/…Mossgrown
Thank you for pointing out that Info.plist and InfoPlist.strings are 2 things... I think many "smart" people like me would overlook their difference when localizing.Channing
M
0

Step by step 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!

Mesquite answered 9/3, 2019 at 14:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.