问题
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