Localize Attributed Strings?
Localize Attributed Strings?
- Subject: Localize Attributed Strings?
- From: "Chunk 1978" <email@hidden>
- Date: Sat, 3 Jan 2009 19:02:03 -0500
is this possible? i have a string that changes color and size
according to the length of the words in the string. however, these
words and their lengths change in different languages. clearly i
could add and NSLocalization wrapper to the string, but the problem is
that the attributes would remain the same.
-=-=-=-=-
NSMutableAttributedString *dayOfWeekStringAttributes =
[[NSMutableAttributedString alloc] initWithString:[NSString
stringWithFormat:@"Day Of Week - %s", dayOfWeek]];
[dayOfWeekStringAttributes addAttribute:NSForegroundColorAttributeName
value:[NSColor grayColor] range:NSMakeRange(11,
([dayOfWeekStringAttributes length]-11))];
[dayOfWeekStringAttributes addAttribute:NSFontAttributeName
value:[NSFont menuFontOfSize:10] range:NSMakeRange(11,
([dayOfWeekStringAttributes length]-11))];
[dayOfWeekStringAttributes addAttribute:NSFontAttributeName
value:[NSFont menuFontOfSize:14] range:NSMakeRange(0, 11)];
[theMenuItem setAttributedTitle: dayOfWeekStringAttributes];
[dayOfWeekStringAttributes release];
-=-=-=-=-
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden