Can .strings resource files be added at runtime?

前端 未结 3 1522
渐次进展
渐次进展 2020-12-07 23:32

I know that in Mac apps one can add .strings files to the project folder to add localizations.

Is there any way that additional localizations can be added to an app

3条回答
  •  时光取名叫无心
    2020-12-08 00:29

    You should be able to achieve this by overriding NSBundle’s various pathForResource:… methods in a category. (I would assume they all go through -pathForResource:ofType:inDirectory:forLocalization:, but this isn’t documented so you can’t rely on it even if it turns out to be the case now, so you should override all of them.)

    I also suggest filing an enhancement request for a clean way of overriding the lookup mechanism.

提交回复
热议问题