save the provided dictionary accross translations
All checks were successful
Build and publish the docker image / build (push) Successful in 38s
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:
parent
76db84f69c
commit
15ffbfae4d
@ -39,6 +39,7 @@ func POST_translate(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
return util.Render(c, "translate", fiber.Map{
|
return util.Render(c, "translate", fiber.Map{
|
||||||
"term": form.Term,
|
"term": form.Term,
|
||||||
|
"dictionary": form.Dictionary,
|
||||||
"fields": trans.Fields,
|
"fields": trans.Fields,
|
||||||
"entries": trans.Entries,
|
"entries": trans.Entries,
|
||||||
"suggestions": trans.Suggestions,
|
"suggestions": trans.Suggestions,
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
<select name="dictionary">
|
<select name="dictionary">
|
||||||
{{range .dictionaries}}
|
{{range .dictionaries}}
|
||||||
<option value="{{.ShortName}}">{{.Name}}</option>
|
{{if and ($.dictionary) (eq $.dictionary .ShortName)}}
|
||||||
|
<option value="{{.ShortName}}" selected>{{.Name}}</option>
|
||||||
|
{{else}}
|
||||||
|
<option value="{{.ShortName}}">{{.Name}}</option>
|
||||||
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</select>
|
</select>
|
||||||
<button type="submit">Translate</button>
|
<button type="submit">Translate</button>
|
||||||
|
@ -8,10 +8,8 @@
|
|||||||
<main>
|
<main>
|
||||||
{{template "search" .}}
|
{{template "search" .}}
|
||||||
|
|
||||||
{{if not .suggestions}}
|
{{if and (not .suggestions) (not .fields)}}
|
||||||
{{if not .fields}}
|
<h3 class="result">No results :(</h3>
|
||||||
<h3 class="result">No results :(</h3>
|
|
||||||
{{end}}
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if .suggestions}}
|
{{if .suggestions}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user