save the provided dictionary accross translations
All checks were successful
Build and publish the docker image / build (push) Successful in 38s

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn 2025-04-05 10:30:59 +03:00
parent 76db84f69c
commit 15ffbfae4d
Signed by: ngn
GPG Key ID: A3654DF5AD9F641D
3 changed files with 8 additions and 5 deletions

View File

@ -39,6 +39,7 @@ func POST_translate(c *fiber.Ctx) error {
return util.Render(c, "translate", fiber.Map{
"term": form.Term,
"dictionary": form.Dictionary,
"fields": trans.Fields,
"entries": trans.Entries,
"suggestions": trans.Suggestions,

View File

@ -6,8 +6,12 @@
{{end}}
<select name="dictionary">
{{range .dictionaries}}
{{if and ($.dictionary) (eq $.dictionary .ShortName)}}
<option value="{{.ShortName}}" selected>{{.Name}}</option>
{{else}}
<option value="{{.ShortName}}">{{.Name}}</option>
{{end}}
{{end}}
</select>
<button type="submit">Translate</button>
</form>

View File

@ -8,11 +8,9 @@
<main>
{{template "search" .}}
{{if not .suggestions}}
{{if not .fields}}
{{if and (not .suggestions) (not .fields)}}
<h3 class="result">No results :(</h3>
{{end}}
{{end}}
{{if .suggestions}}
<h3 class="result">Did you mean...</h3>