xcode don't localize specific strings

房东的猫 提交于 2019-12-11 03:06:57

问题


In my storyboard files, I have multiple strings, which I don't need to localize, their text filled with values from server or code at run-time (author's name, object name, etc.); with initial text filled with something like: 'Label', 'Author Name'. (I want to keep these original values in storyboards, for previewing interface.)

I am using localization with .xliff files.

Can I somehow mark them, so they won't end up in corresponding .xliff files for localization?


回答1:


I'd recommend using text like "$Label$" and "$Author Name$", so first it is obvious in your display that you have a string where something else would need to be substituted, and it makes it obvious to a translator that it shouldn't be translated. As long as they can take simple instructions like "don't translate strings that start and end with a dollar sign".

That's especially useful since something like "Author Name" might appear somewhere else in your UI where you really want it to be translated.



来源:https://stackoverflow.com/questions/31338720/xcode-dont-localize-specific-strings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!