summaryrefslogtreecommitdiff
path: root/src/ui/translation.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-15 12:47:20 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-15 19:03:41 +0200
commiteeb9f8b6306524782e7dcc8ef90797dd5bdae1bf (patch)
treeacfde64b0304d563769f73a7288cacb0568bb179 /src/ui/translation.h
parenteb8da869cf87692a5cbb38803644643cd2e192f6 (diff)
Added a page translation service
This is quite experimental. The page contents are sent to an instance of LibreTranslate (powered by Argos Translate), which may or may not successfully translate the contents without mangling the gemtext markup.
Diffstat (limited to 'src/ui/translation.h')
-rw-r--r--src/ui/translation.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/ui/translation.h b/src/ui/translation.h
new file mode 100644
index 00000000..6966e468
--- /dev/null
+++ b/src/ui/translation.h
@@ -0,0 +1,45 @@
1/* Copyright 2021 Jaakko Keränen <jaakko.keranen@iki.fi>
2
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are met:
5
61. Redistributions of source code must retain the above copyright notice, this
7 list of conditions and the following disclaimer.
82. Redistributions in binary form must reproduce the above copyright notice,
9 this list of conditions and the following disclaimer in the documentation
10 and/or other materials provided with the distribution.
11
12THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22
23#pragma once
24
25#include <the_Foundation/string.h>
26#include <the_Foundation/tlsrequest.h>
27
28iDeclareType(Translation)
29iDeclareType(DocumentWidget)
30iDeclareType(Widget)
31
32struct Impl_Translation {
33 iTlsRequest * request;
34 iWidget * dlg;
35 uint32_t startTime;
36 iDocumentWidget *doc;
37 int timer;
38};
39
40iDeclareTypeConstructionArgs(Translation, iDocumentWidget *)
41
42void submit_Translation (iTranslation *);
43iBool handleCommand_Translation (iTranslation *, const char *cmd);
44
45iBool isFinished_Translation (const iTranslation *);