added translate
This commit is contained in:
parent
df079ee680
commit
9c19db429f
1 changed files with 7 additions and 4 deletions
|
@ -1,9 +1,12 @@
|
||||||
import base
|
import base
|
||||||
import std/[re,httpclient,json,strutils]
|
import std/[re,httpclient,json,strutils]
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Add language detection and translate into HOME language
|
||||||
|
|
||||||
const LIBRETRANSLATE_URL = "https://libretranslate.pussthecat.org/translate"
|
const LIBRETRANSLATE_URL = "https://libretranslate.pussthecat.org/translate"
|
||||||
const PRIMARY = "en"
|
const HOME = "en"
|
||||||
const SECONDARY = "de"
|
const FIRST_CHOICE = "de"
|
||||||
let LANG_RE = re"\w+>\w+"
|
let LANG_RE = re"\w+>\w+"
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -16,8 +19,8 @@ type
|
||||||
proc main(message: varargs[string] = @[])
|
proc main(message: varargs[string] = @[])
|
||||||
|
|
||||||
proc newRequest(): Request =
|
proc newRequest(): Request =
|
||||||
return Request(source:SECONDARY,
|
return Request(source:FIRST_CHOICE,
|
||||||
target:PRIMARY,
|
target:HOME,
|
||||||
q: "",
|
q: "",
|
||||||
format: "text",)
|
format: "text",)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue