storyboard和xib创建本地化是一样的,所以我们是可以同样的方式直接在Info里面创建相应的本地化文件。
然后再里面修改。storyboard这样的文件太多,我们jiang将会使用go工具ibtool这个工具来创建。
使用ibtool工具提取需要本地化的代码如下:
ibtool --generate-string-file MainStoryboard.string en.lproj/ Mainstoryboard.storyboard其中,--generate-string-file表示生成zi'fu'ch'cuan字符串资源文件,Mainstoryboard.strings是要生成的资源文件,Mainstoryboard.storyboard是英文的版本的故事版。
然后再生成其他语言的storyboard和xib文件,
ibtool --string-file MainStoryboard.string --write zh-hans.lproj/ Mainstoryboard.storyboard en.lproj/MainStoryboard.storyboard
这样就可以生成简体中文版本的资源文件。
同时图片和视频等等资源的本地化都是同样的方法和理念,增加图片。