FOAF-a-Matic Translations: More Coming, and How It Works

I’ve just added a comment to Danny’sTranslator exchange for open projects” LazyWeb entry, asking for additional translations of the FOAF-a-Matic. Having a simple bulletin board like this is a great idea. Here’s hoping that it gets some more linkage and pulls in more project requests and translators offering their services.
I’ve already followed-up Diane Panek’s offering of Filipino/Tagalog translation. And, if you’re a dufus like me, then you’ll be interested to know that Tagalog is “…the second most commonly-spoken Asian language (after Chinese) in the United States, and the sixth non-English language spoken in America“. More information available here.
I’ve also had a nice email from Minsu Jang who has offered me a Korean version of the FOAF-a-Matic. I’ve mailed Minsu with instructions, which basically boil down to translating this file.
For the techies out there, here’s some details about how I generate a new version of the application…


The FOAF-a-Matic application has been broken down into a simple XML template. This is basically a well-formed HTML version of the original page with all of the fixed test replaced with elements from a template language I made up. Basically there’s one element for each block of text, e.g. fmt:author, fmt:introduction. There are also field tags (fmt:field) which identify a particular form field.
The text for a specific language version of the application is stored in a separate document, e.g. en.xml. These files just tag up the various blocks of text and fields. Passing one of these file, plus the main page template to this XSLT transformation will generate an HTML version of the application with all the text substituted in the correct locations.
There’s a second transformation step that generates a Javascript file containing the text for various pop-up messages generated by the application. E.g. when a required field isn’t filled in. Here’s the English version. Having this as a two-stage process isn’t strictly required, but I wanted to avoid embedding as much Javascript in the main page as possible.
The two stage process is controlled by a simple Ant build script. This could probably do with being tidied up a little.
Not necessarily the perfect way to handle internationalisation but it was built during a lunch-hour and does the job nicely. The same technique could be applied to other Javascript/HTML applications easily enough.

3 thoughts on “FOAF-a-Matic Translations: More Coming, and How It Works

  1. Hi Leigh, how are you?
    I’ve make a mistake and I send a trackback that it’s wrong. Is the one tracked at August 22, 2003 11:06 PM
    If you can, please, remove it. Thanks, nice post.
    inkel

Comments are closed.