[quiz] [QUIZ #1] Solution by Stuart Sierra
Pascal Bourguignon
pjb at informatimago.com
Wed May 3 19:38:54 UTC 2006
Stuart Sierra writes:
> Jean-Christophe Helary wrote:
> > Is it possible to suggest that the CAPTCHA must be "easily" localizable ?
> > By abstarcting the translatable strings for ex ?
> > that would be parsed for display, and easily translatable to any other
> > language
>
> Abrahamson and I put our strings into global variables, which is fairly
> easy to translate. The only problem is making (format "~r")
> multi-lingual, e.g. (format "~r" 2) => "deux"
It cannot and it must not. Not until there's a new CL standard at least.
But within the current standard, you can write:
(format t "~/localization:format-number-in-french/" 2)
;; or:
(format t "~V/localization:format-number-language/"
(localization:language-index :french) 2)
> > and a "pattern" model that would be parsed to create the "generate-
> > question" code ?
>
> That's a bit trickier, especially when you get into issues of word
> order. FORMAT is pretty good at this, but I don't think you can change
> the order of the arguments, at least not without some ugly hacks.
And you don't need, since FORMAT is pretty good at skipping around the
argument list.
> > I am also a translator in real life and that it is one of
> > the reasons I got interested in Lisp)
>
> See also CL-I10L at http://common-lisp.net/project/cl-l10n/
>
> -Stuart
--
__Pascal Bourguignon__ http://www.informatimago.com/
THIS IS A 100% MATTER PRODUCT: In the unlikely event that this
merchandise should contact antimatter in any form, a catastrophic
explosion will result.
More information about the Quiz
mailing list