简体   繁体   English

Settings.bundle本地化损坏

[英]Settings.bundle Localization Broken

A few weeks ago, I added a Settings bundle to my app and localized its entries following the awesome tutorial by Use Your Loaf . 几周前,我在 Use Your Loaf》精彩教程中添加了一个Settings捆绑包,并将其条目本地化。 Back then, it was working without problem. 当时,它一直没有问题。

Now I came back to my project after a few weeks, same Xcode version (9.3), and found these issues: 现在,几周后,我又回到了我的项目,使用相同的Xcode版本(9.3),发现了以下问题:

  • I can't see the strings files in the Project Navigator: The language folders are missing the expected disclosure controls: 我在项目浏览器中看不到字符串文件:语言文件夹缺少预期的公开控件:

在此处输入图片说明

  • If I delete the Settings bundle and start over, I get: 如果删除设置捆绑包并重新开始,则会得到:

    • Settings.bundle Settings.bundle
    • en.lproj en.lproj
    • Root.plist Root.plist

...but the English language folder is still missing the disclosure indicator. ...但是英语文件夹仍然缺少公开指示器。

  • When I install my app in the device or Simulator and go to the Settings page, the localization keys are displayed (as if the string files for all languages were missing). 当我在设备或模拟器中安装我的应用程序并转到“设置”页面时,将显示本地化密钥 (好像缺少所有语言的字符串文件一样)。

  • However, if I go to the Products folder (from the Xcode Project Navigator, "Show in Finder...") and inspect the contents of my app bundle, and the settings bundle within it, the language directories are there with their respective strings files inside. 但是,如果我转到Products文件夹(从Xcode Project Navigator,“在Finder中显示...”)并检查我的应用程序包的内容以及其中的设置,语言目录及其相应的字符串就在其中里面的文件。

What am I missing? 我想念什么?


Update 更新

I tried creating a new, bare project and adding a settings bundle to that, but I get the same result. 我尝试创建一个新的裸项目并向其中添加设置捆绑包,但是得到的结果相同。 I went back to Xcode 9.2 (which I also have installed), and the issue does not occur . 我回到了Xcode 9.2 (我也已经安装了),并且不会发生此问题 Either there's a bug on 9.3 (unlikely, since it was working when I first added the bundle) or my installation is broken. 9.3上有一个错误(不太可能,因为它在我第一次添加捆绑软件时就在起作用)或我的安装被破坏了。

I just checked and noticed there's an update available for Xcode 9.3 (9.3.1), so I'll download that and try again... 我刚刚检查并发现Xcode 9.3(9.3.1)有可用的更新,因此我将下载并重试...

As I suspected, my installation of Xcode was broken. 正如我所怀疑的那样, 我的Xcode安装被破坏了。

After reinstalling Xcode by updating to 9.3. 通过更新到9.3重新安装Xcode之后。 1 , adding a settings bundle results in the expecyed behaviour: 1 ,添加设置包会导致正常的行为:

在此处输入图片说明

Not the most common scenario, I know, but I hope this answer helps someone in the same situation someday. 我知道这不是最常见的情况,但是我希望这个答案有一天能对处于相同情况的某人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM