• 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
SOLVED - Was: Localization w/ parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED - Was: Localization w/ parameters


  • Subject: SOLVED - Was: Localization w/ parameters
  • From: Frédéric BLANC <email@hidden>
  • Date: Tue, 7 Jan 2003 00:07:20 +0100

Problem: Find a Java substitute to the NSString's stringWithFormat: facility to localize strings which depend on dynamic content.
Ex. : "This folder contains %d items." = "Ce dossier contient %d iliments.";

Solution:
1) Use the following key/value (which kind of breaks the preferred Cocoa model) :
"This folder contains {0,number,integer} items." = "Ce dossier contient {0,number,integer} iliments.";
2) Use the java.text.MessageFormat class to inject the right formatted data at runtime through one of its format() methods.

Thanks to everyone who helped.


- Fred
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Quickly drawing non-antialiased, discrete, pixels
  • Next by Date: SOLVED - Was: How? ("Delete" icon as a men u item shortcut…)
  • Previous by thread: Drag and Drop / AppleScript Problem
  • Next by thread: SOLVED - Was: How? ("Delete" icon as a men u item shortcut…)
  • Index(es):
    • Date
    • Thread