本文介绍了我的Base Internationalization故事板是否必须与所有非本地化语言和字符串的后备语言相对应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查看了苹果开发者的一些国际化文档和视频,但我从未找到过该问题的明确答案。在Apple的教程中,我看到 Base.lproj 文件夹以及 en.lproj zh.lproj - 示例翻译(本地化)是从英语到中文。但他们告诉我,有一个文件 en.lproj / myStoryboard.strings ,这令人困惑。我无法看到为故事板创建英语本地化的意义(已经是英文版)。

I've looked through some internationalization documentation and videos on apple developer, but I never found an explicit answer to that question. In Apple's tutorials I see the Base.lproj folder alongside en.lproj and zh.lproj -- the example translation (localization) is from English to Chinese. But they tell me that there's a file en.lproj/myStoryboard.strings, and that is confusing. I can't see the point in creating an English localization for the storyboard (that is already in English).


  1. 所以我的问题是用户将看到 Base.lproj / myStoryboard.storyboard 中的字符串?

  2. 如果系统在我的捆绑包中找不到用户的首选语言文件夹,那么该文件中的字符串是否必须是向用户显示的默认字符串?

  3. 我可以明确说永远不要使用 Base.lproj / myStoryboard.storyboard ,总是回到 en .lproj / myStoryboard.strings

  1. So my questions are if the user will ever see the strings in the Base.lproj/myStoryboard.storyboard?
  2. Do the strings in that file have to be the default strings that are shown to the user if the system cannot find the user's preferred language folder in my bundle?
  3. Can I explicitly say "never use Base.lproj/myStoryboard.storyboard, always fall back on en.lproj/myStoryboard.strings"?

换句话说:

Let's说我希望每当用户的语言不可用时,我的应用程序都会以英语显示,但我的 Base.lproj / myStoryboard.storyboard 是瑞典语。我是否 将Base Storyboard本地化为 sv.lproj / myStoryboard.strings 并将Base故事板中的所有字符串翻译为英语以完成此操作?

In other words:
Let's say I want my app to display in English whenever the user's language isn't available, but that my Base.lproj/myStoryboard.storyboard is in Swedish. Do I then have to localize the Base Storyboard to sv.lproj/myStoryboard.strings and translate all strings in the Base storyboard to English to accomplish this?

推荐答案


  1. 所以我的问题是用户是否会看到Base.lproj / myStoryboard.storyboard中的字符串?


这是默认使用那些用于开发区域本地化的字符串,通常是英语。如果有一个匹配的英文字符串文件,它将取代故事板中的字符串。这通常是多余的,因此通常不会使用。如果你真的想要同样处理所有语言,你可以这样做。

It is the default to use those strings for the development region localization, which is typically English. If there was a matching strings file for english, it would supersede the strings in the storyboard. This is typically redundant, so it isn't normally used. If you really want all of your languages to be handled identically, you can do this.

这些是不相关的概念。嵌入在故事板中的字符串等同于en.lproj中的字符串。之后,语言回退与没有Base.lproj的情况相同。

These are unrelated concepts. The strings embedded in the storyboard are equivalent to having ones in en.lproj. After that, language fallback works the same as without Base.lproj.

如果你有en.lproj / myStoryboard.strings和英文它是开发语言,它们总是取代Base.lproj / myStoryboard.storyboard中嵌入的英文字符串。包括英语不是首选语言,但最终被选为后备语言。

If you have en.lproj/myStoryboard.strings, and english is the development language, they will always superseded the strings embedded in Base.lproj/myStoryboard.storyboard for English. Including when English isn't the preferred language, but ends up being chosen as the fallback language.

这篇关于我的Base Internationalization故事板是否必须与所有非本地化语言和字符串的后备语言相对应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 05:34