February 4th, 2004

  • evan

i18n disambiguation

We finally ran into a translation problem (see point 4) that I've been anticipating: words that are the same in English but different in other languages. We use "None" for "no music" or "no viewers of this poll question", while Russian needs two different words.

I knew somebody has dealt with this before, and I eventually found it in the gettext manual. The (obvious) solution is to disambiguate the strings in your source code: change "None" to "music|None" and "viewers|None". The non-obvious part is what format to use.

Unfortunately, it appears nobody has standardized on a way to do this. I see some projects that include the disambiguation bit after the text, and even Freeciv has their own standard (see their "Q_" macro). But as the gettext manual says, it's nice to put the disambiguation text before (as Freeciv does, too) because you can do a C string trick for the untranslated case.
  • evan

man, i wish i was in algorithms

Daisy and Tessa were walking behind me and talking about subtree costs on our way to dinner, and I felt left out.

Toby is doing some weird sort of research (all I know it involves representing propositional logic forumulas as graphs) and asked me a question about Dijkstra's algorithm (which I get to be the expert on, because I'm the networks TA) and together we discovered Dial's implementation (warning: tiny text!). That's pretty neat.

I know very close to nothing about algorithms.


Speaking of algorithms, I found my copy of the LJ friends export Brad did a while back. It's from mid-2003, and I think there are 14 million edges in it. The datafile obfuscates userids into random integers, but they're unfortunately 32-bit integers and OCaml* can only do 31-bit integers quickly on x86. So I wrote a C program to reprocess them down to smaller integers (there's only around a million nodes, after all) and produce a binary format and the file is still like a hundred megs.

And from there, I don't know what to do with it. I wanna do popularity contests or whatever but without userids it's not too interesting.

* Of course I'm using OCaml. Duh. :P