简体   繁体   English

如何在源代码控制下将本地化添加到“设置”捆绑中

[英]How do you add localization to the Settings bundle under source code control

I am trying to localize my Settings.bundle. 我正在尝试本地化Settings.bundle。 There does not appear to be anything in Xcode 4 that allows you to add localization to the Settings.bundle similar to localizing a xib file. Xcode 4中似乎没有任何东西可以让您将本地化添加到Settings.bundle中,类似于本地化xib文件。 So I used finder to navigate to the Settings.bundle and copied the en.lproj directory to create directories in the bundle called fr.lproj and de.lproj. 因此,我使用finder导航到Settings.bundle并复制了en.lproj目录,以在捆绑包中创建名为fr.lproj和de.lproj的目录。 From there, you can modify the strings file to localize the titles in the Root.plist. 从那里,您可以修改字符串文件以本地化Root.plist中的标题。

But the problem is that the new directory is not under source code control. 但是问题在于新目录不受源代码控制。 If I try to add the directory to source code control, I get the following error: The operation could not be performed because the selection is invalid. 如果我尝试将目录添加到源代码控制中,则会出现以下错误:由于选择无效,因此无法执行该操作。

How can I resolve this problem and get the new settings.bundle directory under source code control? 如何解决此问题并在源代码控制下获取新的settings.bundle目录?

下面是我添加到Settings.bundle中的本地化目录的图像。如您所见,问号指示目录不在源代码控制之下

Correct strings file format is: "Title" = "title in correct language"; 正确的字符串文件格式为:“ Title” =“正确语言的标题”;

Pay attention "Title" from Root.Plist NOT "Identifier" 注意Root.Plist的“标题”而不是“标识符”

What you are doing is right. 你在做什么是对的。 I can't explain why you are unable to add your new subfolders/files to source control. 我无法解释为什么您无法将新的子文件夹/文件添加到源代码管理中。 I have the exact same structure in an iOS project of mine and these files are under source control like all the others. 我在我的iOS项目中具有完全相同的结构,这些文件像其他所有文件一样,都在源代码控制下。 I don't recall having difficulties adding them. 我不记得添加困难。

Have you tried using git commands directly to add them? 您是否尝试过直接使用git命令添加它们? The integration in XCode is great but in my experience there are time when you do have to use the command line for git. XCode的集成很棒,但是以我的经验,有时候您确实必须使用git的命令行。

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

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