Is it possible to update a localized storyboard's strings?

前端 未结 14 1294
星月不相逢
星月不相逢 2020-11-28 00:13

I localized a part of my application with creating a base.lproj storyboard and 3 string files for it. It was a month ago and after that I added new view controller to app, b

14条回答
  •  渐次进展
    2020-11-28 00:50

    Option 1
    Xcode can “reload” the file by converting the file to either an [Interface Builder Cocoa Touch Storyboard] file type or a [Localizable Strings] file type.

    Select your base storyboard file from the Project Navigator Find the Localization section in the File Inspector. If your file is currently a [Localizable Strings], change it to [Interface Builder Cocoa Touch Storyboard] or vice-versa.
    Xcode should have converted your storyboard to the current version, while preserving your old localization efforts. Here you can change the file back to the original file type if you would like.

    Option 2
    Use ibtool to extract the strings in your storyboard.

    Open the Terminal application
    Locate your Base.lproj directory
    Use this line to extract the strings:

    ibtool MainStoryboard.storyboard --generate-strings-file file_name.strings
    

    After ibtool extracts the strings to file_name.strings, you can copy and paste it to your original .strings file.

提交回复
热议问题