Forum OpenACS Development: Automatic translation of missing language keys

Request notifications

In my attempt to do soap requests from openacs, I used BabelFish as an example that we could easily put to use to automatically translate message strings if no translation is provided:

I needed to install tcldom, tclsoap and tcllib (all without any trouble at all). I read that it might be possible to use tdom instead of tcldom with some patch to tclsoap, but I couldn't find the code for that, but it might turn up somewhere.

All I then needed to do was:

package require SOAP

SOAP::configure -transport http -proxy {}

SOAP::create translate \
      -proxy {} \
      -uri {urn:xmethodsBabelFish#BabelFish} \
      -params { translationmode string sourcedata string }
With this, a proc called "translate" is defined in the current namespace that then can be called with the specified parameters and will return the translated string:
set translation [translate de_en "Hallo Welt, Guten Tag"]
Since this is really as easy as it can get, I think we should think about integrating this in acs-lang, wrapped in a check for those packages that are needed.

Posted by Malte Sussdorff on
I see a lot of potential for this, though not necessary with any error "Missing Language Key", as this hints to a missing default locale string.

But we could turn on Babelfish support seperately with each locale, so the language string would be translated on the fly. It remains debateable whether we should store that string in the OpenACS database though (the latter would boost performance, but then you have language keys in your installation that are not reviewed on the translation server).

In any case, we should at least enable the babblefish translation as the default string for new translations on the translation server (though most likely the experienced translators will moan at this idea).