Can .strings resource files be added at runtime?

前端 未结 3 1525
渐次进展
渐次进展 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:27

    If you want to implement an alternate version of NSLocalizedString() inside your application, there are number of good strategies for that. That would allow you to modify the values used inside your application itself. But those won't work when it comes to Push Notifications.

    Warning however : for iOS Push Notifications that use Localized Strings, there is no legal runtime method modify the built in strings resources that are used to translate the localized arguments sent from your server into the device's native language.

    So if you want to use Localized Strings as part of Push Notifications, you must ship them in the app when you submit to the store. They can't be modified later by loading something from the server.

提交回复
热议问题