How to implement localization in Swift UI

后端 未结 6 2079
迷失自我
迷失自我 2020-12-09 03:31

Can anybody help me? I can\'t find any description of the localization in Swift UI. Can anyone please give advice or better an example of how to localize for example T

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 04:36

    To localise your app you need:

    1. Use SwiftUI elements like: Text("Nice"). Nice becomes the key in Localizable.strings.
    2. In the cases where text is not in the SwiftUI element needs to use NSLocalizedString.
    3. Select you app target.
    4. Export localisation: Edit -> Export for Localisation...
    5. Give exported files to translator.
    6. Import translations: Edit -> Import Localisations...

提交回复
热议问题