在Xcode 4中本地化iPhone应用程序名称

26
当我选择Info.plist文件以使应用程序名称本地化并尝试构建项目时,构建失败,并显示错误消息,指出找不到Info.plist文件。
如果我将Info.plist文件路径更改为PROJECTNAME/en.lproj/Info.plist,则可以构建,但是应用程序的名称未本地化;如果我在葡萄牙语iPhone上运行,则显示英文名称。
为什么会这样?
谢谢,
RL

那是一个带有英语区域设置的葡萄牙iPhone,还是一个带有葡萄牙语区域设置的葡萄牙iPhone? - InsertWittyName
使用英语语言配置iPhone的端口。 - Rui Lopes
将iPhone语言环境更改为葡萄牙语,应用程序就会显示为葡萄牙语。手机的实际位置并不重要。 - InsertWittyName
问题是我希望应用程序的默认语言为英语。我想知道的是如何将应用程序名称本地化为葡萄牙语、法语、德语等语言。 - Rui Lopes
4个回答

48

InfoPlist.strings 添加到您的项目中并进行本地化。将其翻译成以下不同语言:

"CFBundleDisplayName" = "App Name";

3

iPad和iPhone具有不同的可用空间来显示应用程序名称,这可能与它们的图标大小有关(57px vs. 72px)。

因此,有时在iPad上完美适合的内容在iPhone上会被截断。

您可以像这样在iPad和iPhone上使用不同的显示名称:

"CFBundleDisplayName~iphone" = "iPhone display name"
"CFBundleDisplayName~ipad" = @"iPad display name"

3

今晚我找到了一个解决方案/本地化应用程序名称/Xcode 4.5:

  • First change the name of you app: Folder Supporting Files InfoPlist.strings (Portuguese)
  • By selecting InfoPlist.strings (Portuguese), its content will appear in the window right next to it.
  • Put that code inside:

    "CFBundleDisplayName" = "Title in Portuguese";
    
    "CFBundleName" = "Title in Portuguese";
    
  • Then SAVE the file.

  • Go to the iOS simulator, and change language to anything but Portuguese. This will permit to reset the app icon.
  • Run your app.
  • Change your iOS language to Portuguese. You should then see the Portuguese name.

0

点击文件检查器 在本地化部分下添加本地化语言 将CFBundleDisplayName更改为您期望的应用程序包语言 这里 可能会对您有所帮助


问题是,当我这样做时,我在en.proj中保留对${Product Name}的引用,在葡萄牙语中,我更改为葡萄牙语名称。当我在iPhone上运行应用程序时,出现的是英文名称,而不是葡萄牙语名称。 - Rui Lopes

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接