diff options
author | Mert Tumer <mert.tumer@collabora.com> | 2022-07-05 12:03:27 +0300 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2022-09-13 00:02:16 +0200 |
commit | f0b4db7355cffa1f22ed5063db829b1f1f285a72 (patch) | |
tree | cb42d1443c05b3f789c70de29d5f25c7605b09b3 /officecfg | |
parent | d896ad282b6d09666b87442863c2de9ac06daa06 (diff) |
new uno command uno:Translate with deepl api
New Uno command added for translation
right now it is only using deepl translation api
There's a section in the options > language settings
for setting up the api url and auth key
uno:Translate is a menu button under Format tab
which will bring up Language Selection dialog for translation.
DeepL can accept html as the input for translation, this new
feature leverages that by exporting paragraphs/selections to
html and paste them back without losing the formatting (in theory)
This works good in general but we may lose formatting in very complex
styled sentences.
Translation works in two ways;
1) Whole document
when there is no selection, it assumes that we want to translate whole
document. Each paragraphs is sent one by one so that the output timeout
can be minimum for each paragraph.
2) Selection
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ia2d3ab2f6757faf565b939e1d670a7dedac33390
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137199
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'officecfg')
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 8 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs | 22 |
2 files changed, 30 insertions, 0 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index f6e4a8f4f466..330fd3c0bb9a 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -1341,6 +1341,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:Translate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Translate...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:FormatColumns" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Co~lumns...</value> diff --git a/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs b/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs index a3fc5f1296c8..c80db6c6aa09 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Linguistic.xcs @@ -444,6 +444,28 @@ </prop> </group> </group> + <group oor:name="Translation"> + <info> + <desc>Contains translation relevant settings.</desc> + </info> + <group oor:name="Deepl"> + <info> + <desc>Contains DeepL API relevant settings.</desc> + </info> + <prop oor:name="ApiURL" oor:type="xs:string"> + <info> + <desc>Deepl Translator API URL</desc> + <label>URL for the Deepl translator api</label> + </info> + </prop> + <prop oor:name="AuthKey" oor:type="xs:string"> + <info> + <desc>Deepl Translator API URL Authkey</desc> + <label>Auth key for the Deepl translator api</label> + </info> + </prop> + </group> + </group> <group oor:name="Hyphenation"> <info> <desc>Contains hyphenation relevant settings.</desc> |