storyboard 和xib的本地化的应用

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

这样就可以生成简体中文版本的资源文件。


同时图片和视频等等资源的本地化都是同样的方法和理念,增加图片。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值