/t : Simple Translation Service
This request handler implements the /t/*/*/* web service which provides a simple text-only interface for retrieving translations from WWL. The web service is called via a RESTful interface as follows:/t/{source_language}/{target_language}/{escape encoded text}
or
/t/{source_language}/{target_language}
or
/t with the parameters
- sl = source language code (if not in URL)
- tl = target language code (if not in URL)
- st = source text (UTF-8 or ASCII only, no other encodings supported, if not in URL)
- allow_anonymous = y/n (allow anonymous translations, default = y)
- allow_machine = y/n (allow machine translations, default = y)
- min_score = minimum average quality score (0 to 5, default 0)
- domain = optional domain
- url = optional url
- lsp = name of professional translation service provider (will request a professional translation)
- lspusername = username to submit to professional translation svc (overrides system default)
- lsppw = password or API key to submit to professional translation svc (overrides system default)
- queue = add translation to translation queue for third party service (e.g. beextra.org)
- mtengine = request translation via a specific machine translation service, if not specified will select MT engine automatically using defaults in mt.py
- ttl = cache time to live (for professional translations), in seconds
- ip = dotted IP address or prefix (e.g. ip=206.1.2) to limit results to translations submitted from a specific IP address or range (so you can ignore submissions that were not posted from a trusted gateway you control)
- output = text|html|xml|rss|json|google (google will mimic Google Translate API and response format)
This interface makes it easy to merge translations into web documents as they are served, as it can be used as a type of server side include. This enables a website to exert direct control over how translations are displayed, to cache them locally and host the translations on the same publishing or web application environment. Note that this can also be used to localize a web interface as it provides a simple gettext() style interface for fetching a translation for a string.
NOTE: we _strongly_ recommend that you use the POST method to submit texts for translation. You can use HTTP GET for requests, but you need to be very careful to correctly encoded texts.