by Erik van der Poel <firstname.lastname@example.org>
Last Modified: 1/24/2001
IntroductionProgrammers often compose sentences from smaller pieces using mechanisms such as C's printf family of functions. Since sentence syntax is highly dependent on human language, it is necessary to vary the order in which Subject, Verb and Object appear in the sentence.
How to do this in Mozilla
Use nsTextFormatter. You can find examples of this in the sources. Use LXR to find examples. Here is an example of a string with ordered arguments:
"There are %1$d files in directory %2$s."