我在xcode中添加了一个本地化,将其删除,现在我的故事板已经消失了 [英] I added a localization in xcode, removed it and now my storyboard is gone

查看:168
本文介绍了我在xcode中添加了一个本地化,将其删除,现在我的故事板已经消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想尝试本地化我的应用。我的项目文件夹中只有一个Storyboard.storyboard。

So I wanted to try localizing my app. I had one single Storyboard.storyboard in my project folder.


  1. 我选中了使用基础国际化复选框,然后xcode对我做了一些事情。文件。

  2. 我继续添加第二个本地化

  3. Xcode告诉我它无法创建一些.plist,因为它已经存在。

  4. 我最终得到了两个故事板(Base和English组合在一起),这非常奇怪,因为文档清楚地说我只需要处理一组故事板(当使用基础交互时)并且其他语言将是字符串文件:

  1. I checked the "use base internationalization" checkbox and then xcode did something with my files.
  2. I proceeded to add a second Localization
  3. Xcode told me it couldn't create some .plist since it already existed.
  4. I ended up with two storyboards ("Base" and "English" grouped together), which was very strange since the documentation clearly said I would just have to deal with one set of storyboards (when using base intertationalization) and that the other languages would be strings-files:

基础国际化,Xcode 4.5中引入的一项功能,可以减轻需要的本地化程序(即翻译人员)修改应用程序支持的每种语言的故事板和nib文件。相反,应用程序只有一组故事板或nib文件本地化为默认语言;这些故事板和笔尖被称为基础国际化。当您向应用程序添加本地化时,Xcode会为每个故事板或nib文件显示或包含的所有文本生成一个字符串文件,作为辅助功能标签或提示。 Xcode为文件提供了故事板的名称和扩展字符串。因此,如果您有一个名为MyStoryboard.storyboard的故事板,则生成的字符串文件名为MyStoryboard.strings。

Base internationalization, a feature introduced in Xcode 4.5, relieves localizers (that is, translators) of the need to modify storyboards and nib files for each language an app supports. Instead, an app has just one set of storyboards or nib files that is localized to the default language; these storyboards and nibs are called the base internationalization. When you add a localization to an app, Xcode generates a strings file for all the text that each storyboard or nib file displays or includes as an accessibility label or hint. Xcode gives the file the name of the storyboard and the extension strings. So if you have a storyboard named MyStoryboard.storyboard, the generated strings file is named MyStoryboard.strings.


  • 我删除了新创建的本地化(英语)因为这不是我的预期

  • 现在所有的故事板都没了,即使我只删了一个本地化

  • 我的垃圾箱里现在有两个故事板(一个是storyboard.storyboard,一个是名为storyboard 一些数字 .storyboard),但我不知道1)哪一个我应该使用,2)它是否应该在某种子文件夹中,因为我检查了基础国际化选项?那些.plists怎么样?我在上阅读了相关内容。页面但它告诉我点击哪里比告诉我不同​​文件的目的做得更好,所以我不知道如何正确扭转这个

    I have two storyboards in my trash now (one "storyboard.storyboard" and one named storyboardsome numbers.storyboard), but I have no idea 1) which one I should use, and 2) is it supposed to be in some sort of subfolder now since I checked the "base internationalization" option? What about the .plists? I read up on things on this page but it did a better job on telling me where to click than telling me the purpose of the different files, so I have no idea how to reverse this properly

    更新:

    现在,当我重新启动xcode时它看起来像这样:

    Now it looks like this when I restart xcode:

    我不知道从哪里开始。 ..

    I have no clue where to go from here...

    推荐答案

    对于垃圾箱中的故事板,我会尝试打开它们,看看哪个是正确的。而对于使用.strings文件而不是必须本地化整个故事板,在使用基础国际化时,您有一个选项。您可以通过更改本地化下的选项来更改它(当您打开故事板时,这位于左侧窗格下方)

    For the storyboards in the trash, I would try opening them both up and seeing which is correct. And for using .strings files instead of having to localize the whole storyboard, when using base internationalization you have an option. You can change it by changing the option here under localization (this is under the left pane when you open the storyboard)

    将选项从界面构建器更改为可本地化的字符串,您不必使用故事板。不同之处在于界面构建器之一,您必须编辑所有标签和任何您想要本地化的内容,就像编辑任何其他故事板一样,这可能很乏味。通过基本上为您提供整个故事板中所有文本的列表,并通过翻译文本来改变他们所说的内容,而不必编辑整个故事板文件,字符串文件可以轻松实现。

    Change the option from interface builder to localizable strings, and you don't have to use the storyboard. The difference is in the interface builder one, you would have to edit all labels and anything you want to localize like you would edit any other storyboard, which can be tedious. The strings file makes it easy by basically giving you a list of whatever text you have in your whole storyboard and letting you change what they say by translating the text, instead of having to edit the whole storyboard file.

    这篇关于我在xcode中添加了一个本地化,将其删除,现在我的故事板已经消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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