add reverso alternatie words
All checks were successful
mozhi pipeline / Push Docker image to Codeberg docker registry (push) Successful in 27m47s
mozhi pipeline / Build and publish artifacts (push) Successful in 1h28m26s

This commit is contained in:
2024-05-23 12:45:47 +05:30
parent a17c3b527e
commit 8bc0feb88b
4 changed files with 111 additions and 1 deletions

View File

@@ -143,6 +143,9 @@
{{ if eq .Engine "yandex" }}
{{ template "yandex_extras" . }}
{{ end }}
{{ if eq .Engine "reverso" }}
{{ template "reverso_extras" . }}
{{ end }}
</form>
<script>
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0

55
views/reverso_extras.html Normal file
View File

@@ -0,0 +1,55 @@
{{ if .Translation.WordChoices }}
<div id="definitions_and_translations">
<div class="translations">
{{ if or .Translation.TargetSynonyms .Translation.SourceSynonyms }}
<span class="def_type">Synonyms &amp; Antonyms</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 }}
{{ if .Translation.TargetAntonyms }}
<li>
<span class="syn_type">Antonyms for {{.Translation.OutputText}}</span>
<span class="syn">{{ range $index, $key := .Translation.TargetAntonyms }}{{ if eq $key "" }}{{ else }}{{ if eq $index 0 }}{{ else }}, {{ end }}{{.}}{{ end }}{{ end }}</span>
</li>
<br>
{{ end }}
{{ if .Translation.SourceAntonyms }}
<li>
<span class="syn_type">Antonyms for {{.OriginalText}}</span>
<span class="syn">{{ range $index, $key := .Translation.SourceAntonyms }}{{ if eq $key "" }}{{ else }}{{ if eq $index 0 }}{{ else }}, {{ end }}{{.}}{{ end }}{{ end }}</span>
</li>
<br>
{{ end }}
</ul>
{{ end }}
</div>
<div class="definitions">
{{ range $key := .Translation.WordChoices }}
<span class="def_type">{{ $key.Word }}</span>
<ol>
{{ range $index, $key2 := $key.ExamplesSource }}
<li>
<br>
<span class="use_in_sentence">{{ index $key.ExamplesSource $index }}</span>
<br>
<span class="use_in_sentence">{{ index $key.ExamplesTarget $index }}</span>
<br>
</li>
{{ end }}
</ol>
{{ end }}
</div>
</div>
{{ end }}