Localizing attributed UITextView from storyboard

后端 未结 4 1983
梦谈多话
梦谈多话 2021-01-01 16:00

I am using the storyboard and have a view where I have subclassed some UITextViews.

My problem is that I am using ibtool --generate-strings-file to extr

4条回答
  •  情话喂你
    2021-01-01 16:30

    It wouldn't make sense to localize attributed text from the storyboard as you would need to know where to apply the attributes after the translation. The word order might have changed and where you would have specified some blue bold text for instance might no longer make sense.

    You can of course still do it via code where you can split up your string in multiple ones and localize them individually. Then you can specify setAttributes:range: so that you know that the right attributes will always be applied on the right range of the string.

提交回复
热议问题