目标 C InfoPlist.string 本地化 - 使用应用名称



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

如何在字符串中使用它?

像这样:

/* 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";

您可以使用$(PRODUCT_NAME)来引用.appinfo.plist中的名称。

例如:"$(PRODUCT_NAME) requires camera permission.">

它会像"YourAppName requires camera permission.">

最新更新