On Wed, Mar 05, 2008 at 06:17:05PM -0800, Robin Lee Powell wrote: > > So I gots me a web app to write. > > I also want to be prepped for other (spoken) languages, for similar > reasons, and because I'm nerdy that way. There are libraries that > will allow insertion of arbitrary Scheme into otherwise normal HTML > files (i.e. spiffy's ssp stuff). There are other libraries that > allow writing a web page as Scheme (i.e. hart). > > Does any one have any other suggestions, or preferences amongst > those options, or anything?
I've spent a bit of time thinking about this (unfortunately, no time to code it up yet). At work we use Drupal, which simply requires you to wrap translatable strings with a function call to t(...). This is a solution that absolutely does not scale well because everytime it sees a t() call, it hits the database to retrieve the string. It caches pages, but still we see a lot of overhead in the roundtrips to the database for uncached pages. So I've been thinking, if you use sxslt translations (or similar s-expression based templates), you can first extract all translatable strings by folding over the template _just_ before you rewrite the s-expressions to HTML/XML strings, then you do one big query to request them all at once, and then you insert the strings as needed. Example: `(html (head (title (trans "this is a test"))) (body (h1 (trans "My first test")) (p (trans "we have some testing stuff here")))) Then, you have one translation step that extracts all the (trans ..) things, resulting in the list ("this is a test", "My first test", "we have some testing stuff here") which then can be used in one query that returns the translations. After that, you go through the sxml again and replace all (trans "..") by their translation. Sorry for the hand-waving - I wouldn't have put this out without code to back it, but it would be a shame if you would go about it the Drupal way and then would have to reimplement something. Cheers, Peter -- http://sjamaan.ath.cx -- "The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." -- Donald Knuth
pgpyG958vbiTf.pgp
Description: PGP signature
_______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users