My old code uses NSLocalizedString to display the following where outputText was an NSMutableString that contained many such lines in a single output session:
[outputText appendFormat: NSLocalizedString(@"\n\n%@ and %@ are identical. No comparison required.", @"\n\n%@ and %@ are identical. No comparison required."), self.ipAddress, secAddress.ipAddress];
I'm trying to change the color of the various ipAddress strings, but can't find a similar method when using NSMutableAttributedString.
The biggest problem I'm facing is that since this entire string will be localized, I can't reliably set the NSRange without breaking up each part of the formatted output.
Do I need to dissect each part of this string, convert it to NSAttributedString and append each piece to the outputText??
The answer is: yes.
Yes, you need to localize sections with different attributes separately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With