iPhone:是否可以在许多文件中分割Localizable.strings [英] iPhone : Is it possible to split Localizable.strings in many files
问题描述
我想知道是否可以在许多子文件中分发"翻译资源(我的"Localizable.strings"文件).
I'd like to know if it is possible to "distribute" the translation resources (my "Localizable.strings" files) in many subfiles.
实际上,在我的应用程序中,我将文本文章存储在许多文件夹中,并且我想将每篇文章的译文放在原始文章的旁边,也就是说放在其自己的文件夹中.
Indeed, in my application, I store text articles in many folders, and I'd like to put the translations of each articles just aside the original article, that means in its own folder.
总而言之,我想使用这种层次结构:
To summarize, I'd like to use this kind of hierarchy :
资源/
-文章/
-First_Article/
--- Content.article
--- Localizable.strings/
---- en
---- fr
-Second_Article/
--- Content.article
--- Localizable.strings/
---- en
---- fr
Resources/
- Articles/
-- First_Article/
--- Content.article
--- Localizable.strings/
---- en
---- fr
-- Second_Article/
--- Content.article
--- Localizable.strings/
---- en
---- fr
有人会对可行性以及如何做到这一点有想法吗? :)
Would anyone have an idea about the feasibility and how to achieve to do this ? :)
多谢
推荐答案
您可以使用以下方法做到这一点:
You can do this by using the following:
NSLocalizedStringFromTable(self,@"second_article",@"");
但是,您不应两次使用名称Localizable.strings.而是执行以下操作:
You should however not use the name Localizable.strings twice. Instead do the following:
- second_article.strings/
-- en
-- fr
这篇关于iPhone:是否可以在许多文件中分割Localizable.strings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!