added translate

This commit is contained in:
Paul Wilde 2022-05-10 22:27:54 +01:00
parent df079ee680
commit 9c19db429f

View file

@ -1,9 +1,12 @@
import base
import std/[re,httpclient,json,strutils]
# TODO: Add language detection and translate into HOME language
const LIBRETRANSLATE_URL = "https://libretranslate.pussthecat.org/translate"
const PRIMARY = "en"
const SECONDARY = "de"
const HOME = "en"
const FIRST_CHOICE = "de"
let LANG_RE = re"\w+>\w+"
type
@ -16,8 +19,8 @@ type
proc main(message: varargs[string] = @[])
proc newRequest(): Request =
return Request(source:SECONDARY,
target:PRIMARY,
return Request(source:FIRST_CHOICE,
target:HOME,
q: "",
format: "text",)