NSLocationWhenInUseUsageDescription使用.strings文件无法正常工作 [英] NSLocationWhenInUseUsageDescription localization using .strings file not working

查看:260
本文介绍了NSLocationWhenInUseUsageDescription使用.strings文件无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Base Localization将我的应用程序翻译成土耳其语。但是,我还需要在Info.plist文件中翻译 NSLocationWhenInUseUsageDescription 键。我做了我为其他一切所做的事情:

I've completed translating my app to Turkish using Base Localization. However, I also need to translate NSLocationWhenInUseUsageDescription key in my Info.plist file. I did exactly what I did for everything else:

去文件检查员并检查土耳其语:

Went to File inspector and checked Turkish:

然后我去了新的字符串资源并通过将此密钥添加到本地化文件来完成我的翻译:

Then I went to the new strings resource and completed my translation by adding this key to the localization file:

NSLocationWhenInUseUsageDescription=[我对位置权限的土耳其描述];

保存,编译,甚至从设备删除应用程序并重建,但无济于事。当我的应用程序询问位置权限时,下面的解释仍然是英文版本(我已尝试在英文翻译文件中包含英文翻译,但它没有改变任何内容)。

Saved, compiled, even deleted app from device and rebuilt, but no avail. When my app asks for location permissions, the explanation underneath is still the English one (I've tried including the English translation as well under Base translation file, but it didn't change anything).

其他一切都是土耳其语,翻译得很好。这只是不翻译的位置许可。我也见过如何本地化一个字符串在iOS info.plist文件中?并添加本地化资源可以混合= YES 键(当然,作为 CFBundleAllowMixedLocalizations ,不是字面上的那句话)我的原始plist但也没有改变任何东西。

Everything else is Turkish, translated just fine. It's just the location permission that doesn't translate. I've also seen How to localise a string inside the iOS info.plist file? and added the "Localized resources can be mixed" = YES key (of course, as CFBundleAllowMixedLocalizations, not literally that sentence) to my original plist but that also didn't change anything.

我该如何解决这个问题?

How can I solve the problem?

推荐答案

我已经重新开始了。删除了翻译,清理了项目,然后再次尝试。有效。我不知道为什么它最初没有。

I've started over. Removed the translations, cleaned the project, and tried again. It worked. I have no idea why it didn't initially though.

这篇关于NSLocationWhenInUseUsageDescription使用.strings文件无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆