• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Localize Attributed Strings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Localize Attributed Strings?
      • From: Douglas Davidson <email@hidden>
References: 
 >Localize Attributed Strings? (From: "Chunk 1978" <email@hidden>)

  • Prev by Date: Re: Immediate Nib Loading Error
  • Next by Date: NSAppleScript returns wrong result on multiple Safari windows, applescript editor work
  • Previous by thread: Localize Attributed Strings?
  • Next by thread: Re: Localize Attributed Strings?
  • Index(es):
    • Date
    • Thread