Localization in Swift 2

前端 未结 3 1946
生来不讨喜
生来不讨喜 2021-01-11 19:13

I want to localize my application; I am using Swift 2. I followed this tutorial but I experience 2 issues.

1. Localized image disappears for both languages

相关标签:
3条回答
  • 2021-01-11 19:55

    I'm a bit late, but if you're still searching for a solution for task #1:

    You could use the solutions presented in that tutorial; there's a Internationalization of Images section.

    "After selecting [your image] in Project navigator, click Localize button under File Inspector. This should provide you with the option to Localize the file in English and German."

    That being said, I'm unsure whether this would work on Swift 2 (if you're still on there); but that should be possible with an up-to-date Xcode/IDE.

    0 讨论(0)
  • 2021-01-11 20:01
    1. I think you have missed the semi-colon on the Localizable.strings after each key-value pair.
    0 讨论(0)
  • 2021-01-11 20:12

    In the Localizable.strings for English and German you have missed the semi-colon at the end of statement.

    It should be like :

    "buttonTitle" = "MyButton"; and

    "buttonTitle" = "MeinButton";
    

    You can refer Apple docs for this.

    0 讨论(0)
提交回复
热议问题