fix deepl (partial fix for #55)
Some checks are pending
mozhi pipeline / Build and publish artifacts (push) Waiting to run
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Waiting to run

This commit is contained in:
2024-12-27 13:00:24 +05:30
parent 8d3855589f
commit 6acd8e6658
4 changed files with 154 additions and 18 deletions

23
views/deepl_extras.html Normal file
View File

@@ -0,0 +1,23 @@
<div id="definitions_and_translations">
<div class="translations">
{{ if or .Translation.TargetSynonyms .Translation.SourceSynonyms }}
<span class="def_type">Synonyms &amp; Equivalent Words</span>
<ul>
{{ if .Translation.TargetSynonyms }}
<li>
<span class="syn_type">Synonyms for {{.Translation.OutputText}}</span>
<span class="syn">{{ range $index, $key := .Translation.TargetSynonyms }}{{ if eq $key "" }}{{ else }}{{ if eq $index 0 }}{{ else }}, {{ end }}{{.}}{{ end }}{{ end }}</span>
</li>
<br>
{{ end }}
{{ if .Translation.SourceSynonyms }}
<li>
<span class="syn_type">Synonyms for {{.OriginalText}}</span>
<span class="syn">{{ range $index, $key := .Translation.SourceSynonyms }}{{ if eq $key "" }}{{ else }}{{ if eq $index 0 }}{{ else }}, {{ end }}{{.}}{{ end }}{{ end }}</span>
</li>
<br>
{{ end }}
</ul>
{{ end }}
</div>
</div>

View File

@@ -163,6 +163,9 @@
{{ if eq .Engine "google" }}
{{ template "google_extras" . }}
{{ end }}
{{ if eq .Engine "deepl" }}
{{ template "deepl_extras" . }}
{{ end }}
</form>
<script>
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0