iPhone : Is it possible to split Localizable.strings in many files

我的未来我决定 提交于 2019-12-10 15:08:42

问题


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 :

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 ? :)

Thanks by advance


回答1:


You can do this by using the following:

 NSLocalizedStringFromTable(self,@"second_article",@"");

You should however not use the name Localizable.strings twice. Instead do the following:

- second_article.strings/
-- en
-- fr


来源:https://stackoverflow.com/questions/2094377/iphone-is-it-possible-to-split-localizable-strings-in-many-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!