[quiz] [QUIZ #1] Solution by Stuart Sierra

Richard Newman rnewman at tellme.com
Wed May 3 17:11:55 UTC 2006


> How hard would that be to have a "source" file including things  
> like key=value for the localizable strings:

The way this is done in, say, Cocoa is to have a localisation file  
containing format strings:

English: "what is ~S times ~S?"
Greeble: "~S dfsiiikkkkkk ~S!"

and bind the format strings at runtime after loading the appropriate  
file.

Better still is to allow the order of arguments to change. I can't  
remember how Cocoa gets around this, but I'm sure it does.

The key is to parameterise the output, and make all output  
conditional on the language. FORMAT is actually a reasonable way to  
do this, as one can always jump around in the input.

-R



More information about the Quiz mailing list