{% extends 'base.html' %} {% block content %}
/translate
end point accepts GET and POST requests with the following args:source
-- source text. Can be a single string or a batch (i.e., list of strings)src_lang
-- source language ID, e.g., eng_Latn
tgt_lang
-- target language ID, e.g., eng_Latn
HTTP Clients may send these parameters in three ways:
Query parameters (GET)
For example:
URL encoded form (POST)
$ curl --data "source=Comment allez-vous?" --data "source=Bonne journée" \
--data "src_lang=fra_Latn" --data "tgt_lang=eng_Latn" \
http://localhost:6060/translate
JSON body (POST)
$ curl -H "Content-Type: application/json" -X POST \
http://localhost:6060/translate \
--data '{"source": ["Comment allez-vous?"], "src_lang": "fra_Latn", "tgt_lang": "kan_Knda"}'
{{ key }} | {{ value }} |
---|