3

Currently using Xcode 6.3

In our (open source) application we have two targets:

  • Our main application 'Client'
  • An action extension 'ShareTo'

Both targets have localized strings via NSLocalizedString().

When I "Export for Localization", I see one <file> extension in the exported XLIFF file named Client/Localizable.strings that contains the strings for both the main application and the app extension.

Same results when doing an export from the command line via xcodebuild.

I am very sure that this export behavior changed over time: previously the strings from the app extension would end up in a separate Extensions/ShareTo/Localizable.strings entry in the XLIFF file. Not combined in Client/Localizable.strings.

So now I am wondering, is this new and correct behavior? Does this mean that app extensions lookup strings in their parent's bundle?

4

1 回答 1

2

真的没关系。如果 Xcode 喜欢一个,那么您可以将两个文件连接在一起。
在较大的项目中,我们将使用多个 .strings 文件,而不是一个 Localizable.strings,每个类一个或一个分配给特定类的每个类,NSLocalizedStringFromTable();
只需确保将字符串文件复制到两个包(检查文件检查器,右侧边栏第一个选项卡)。

于 2015-04-11T12:36:18.460 回答