skipsTranslation
An attribute that marks portions of an attributed string to be excluded from translation.
Declaration
let skipsTranslation: AttributeScopes.TranslationAttributes.SkipTranslationAttributeDiscussion
Use this to exclude specific text ranges within an AttributedString from translation, such as proper nouns, brand names, technical terms, or other content that should remain unchanged across different languages.
When translating formatted text, you can mark specific ranges to skip translation:
var text = AttributedString("Welcome to Apple Park")
let range = text.range(of: "Apple Park")!
text[range].skipsTranslation = trueWhen translated the string, “Welcome to” changes to the target language, but “Apple Park” remains unchanged.