rub*_*ken 6 xcode localization info.plist
我正在尝试使用${PRODUCT_NAME}
Info.plist 中的变量,但在我本地化的 InfoPlist.strings 文件中使用它,该文件将在弹出通知时显示应用程序名称。这甚至可能吗?
当我尝试以这种方式执行此操作时,我会收到一个带有正确语言的弹出窗口,但它显示$(PROGRAM_NAME)
而不是"My App Name"
......
Info.plist:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>${PRODUCT_NAME} would like to use your current location while using the app and in the background</string>
InfoPlist.strings (EN):
"NSLocationAlwaysAndWhenInUseUsageDescription" = "${PRODUCT_NAME} would like to use your current location while using the app and in the background";
InfoPlist.strings (FR):
"NSLocationAlwaysAndWhenInUseUsageDescription" = "${PRODUCT_NAME} souhaiteraient utiliser votre emplacement actuel en utilisant l'application et en arrière-plan";
Run Code Online (Sandbox Code Playgroud)
小智 1
基于此解决方案:/sf/answers/1952043971/
我创建了一个自定义运行脚本并以这种方式对其进行了调整:
for i in `dirname "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"`/*.lproj/InfoPlist.strings
do
# replace App name in App bundle's info.plist
plutil -convert json "$i"
sed -i -e 's/$(MY_APP_NAME)/'${MY_APP_NAME}'/g' "$i"
plutil -convert binary1 "$i"
rm "$i-e"
done
Run Code Online (Sandbox Code Playgroud)
MY_APP_NAME是 xcconfig 中用户定义的值
归档时间: |
|
查看次数: |
217 次 |
最近记录: |