Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 目标C InfoPlist.strings已本地化-使用应用程序名称_Objective C_Localization - Fatal编程技术网

Objective c 目标C InfoPlist.strings已本地化-使用应用程序名称

Objective c 目标C InfoPlist.strings已本地化-使用应用程序名称,objective-c,localization,Objective C,Localization,我有一个${PRODUCT_NAME}来引用我所有目标的应用程序名称。我想在InfoPlist.strings中使用它,以便在CamerauseAgeDescription和其他描述中使用目标名称 我如何在字符串中使用它 大概是这样的: /* Localized versions of Info.plist keys */ "NSLocationWhenInUseUsageDescription" = "Allows geolocation to send your location in t

我有一个${PRODUCT_NAME}来引用我所有目标的应用程序名称。我想在InfoPlist.strings中使用它,以便在CamerauseAgeDescription和其他描述中使用目标名称

我如何在字符串中使用它

大概是这样的:

/* Localized versions of Info.plist keys */

"NSLocationWhenInUseUsageDescription" = "Allows geolocation to send your location in the chat or know which institutions and services are near you";
"NSContactsUsageDescription" = "To be able to talk with the contacts who have ${PRODUCT_NAME} we need to access your agenda";
"NSPhotoLibraryUsageDescription" = 'Allows ${PRODUCT_NAME} to access the gallery to be able to send photos through the chat';
"NSCameraUsageDescription" = "Allows access to the camera to make a photo and send it";
"NSContactsUsageDescription" = "To be able to talk with the contacts who have ${PRODUCT_NAME} we need to access your agenda";
"NSPhotoLibraryAddUsageDescription" = "Allows access to save the images received by the chat";
您可以使用
$(产品名称)
info.plist
中引用应用程序名称

例如:“
$(产品名称)需要相机许可。


它就像“
YourAppName需要摄像头许可。

我使用的是InfoPlist.strings,因此对此方法的响应(我昨天检查过)是:“$(产品名称)允许地理定位发送聊天中的位置,或者知道哪些机构和服务离你很近。”@Lordvermis我不明白你的意思。这个问题已经解决了还是还在考虑中?如果未解决,请详细说明。对不起,我没有正确解释。这不起作用,因为模式ask for permission不显示PRODUCT_NAME值,而是将$(PRODUCT_NAME)精确显示为文字。这个问题没有解决。我的意思是,使用这个公式不会将$(PRODUCT_NAME)转换为它的值。我创建了一个示例应用程序,向您展示本地化如何处理.plist文件。我已经本地化了。plist为法语和英语。测试用例:将设备语言更改为法语或英语,然后运行示例项目。PS:每次运行应用程序时都需要卸载它,因为权限弹出窗口只出现一次。链接到示例应用程序:如果我以任何方式帮助过你,请向上投票。谢谢:)@lordweris你检查过示例应用程序了吗?