Re: Localize Attributed Strings?
Re: Localize Attributed Strings?
- Subject: Re: Localize Attributed Strings?
- From: Alastair Houghton <email@hidden>
- Date: Tue, 6 Jan 2009 17:22:14 +0000
On 4 Jan 2009, at 00:02, Chunk 1978 wrote:
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.
One way is to store your string's contents in an RTF file that you
include as a resource in your application, then load its contents
using -[NSAttributedString initWithPath:documentAttributes:] (or
similar). You can use -[NSBundle pathForResource:ofType:] to find the
path for the correct localized variant.
There are many variations on the above, but hopefully that should get
you on the right track.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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