Localizing Info.plist variable with appended string

淺唱寂寞╮ 提交于 2019-12-04 03:39:24
Dustin

You will need a custom script to do this. Here is one that is working for me

PREFIX_IDENTIFIER="=com.mycompany.bundlenameprefix="
PREFIX=""

if [ $CONFIGURATION == "Debug" ]
then
    PREFIX="α "
fi

if [ $CONFIGURATION == "Enterprise" ]
then
    PREFIX="β "
fi

for i in `dirname "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"`/*.lproj/InfoPlist.strings
do
    plutil -convert json "$i"
    sed -i -e "s/${PREFIX_IDENTIFIER}/${PREFIX}/g" "$i"
    plutil -convert binary1 "$i"
done

Then in your InfoPlist.strings add a prefix to the bundle name like so

CFBundleDisplayName = "=com.mycompany.bundlenameprefix=My App";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!