• 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
Less verbose way to localize a string with a default value?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Less verbose way to localize a string with a default value?


  • Subject: Less verbose way to localize a string with a default value?
  • From: Dave DeLong <email@hidden>
  • Date: Mon, 09 Nov 2009 10:20:11 -0700

Hi everyone,

I want to use the NSLocalizedStringWithDefaultValue macro in my code (so I can see the proper strings in the UI as I debug), but it's awfully verbose. For example:

NSLocalizedStringWithDefaultValue(@"LibraryFolderTitle", (nil), [NSBundle mainBundle], @"Library", @"Library folder title")

I created a simple macro called DDLocalizedStringWithDefaultValue that just takes the key and the default value, and inserts the (nil) and [NSBundle mainBundle] bits for me. The problem is that genstrings doesn't recognize my macro.

Is there a way I can allow for localized strings with a default value, not have to be so verbose, but still have it be recognized by genstrings?

Thanks,

Dave

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Less verbose way to localize a string with a default value?
      • From: BJ Homer <email@hidden>
  • Prev by Date: Re: beginner question, NSNumber, NSDecimalAsNumber
  • Next by Date: Re: Dialog boxes with dynamic contents
  • Previous by thread: Re: Creating a small timer?
  • Next by thread: Re: Less verbose way to localize a string with a default value?
  • Index(es):
    • Date
    • Thread