简体   繁体   中英

Localizing UIViewController using Storyboard

I have pre-existing UIViewController with localization. I've added new UIViewController in the default English Local and I was expecting it will create for me same form in the other Storyboard local. But that is didn't happen.

So now, I only have this new UIViewController in English Storyboard only.

Is there away, either to copy this new UIViewController to the other Storyboard local, or instruct Xcode to create this UIViewController in the other local?

In your Project properties, If you use the Localizations section, there you can add the localized language and related resources for the localized language. It will ask you to generate particular files/resource for localized language, resources can be your controllers, plist files,localizable files etc.

I've faced the same problem, so I just selected new UIViewController (whole VC scene) in "English" storyboard and copy-pasted it to another locale's storyboard. Then I made my "locale dependent" changes.

If you just have a new viewcontroller you can copy/paste, but if you have a lot of new changes look at this video and read the description too, the guy created a python script that changes other storyboads according to the base storyboard you select, adding new items to the other localized storyboards. I tried some time ago and worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM