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{
|
||||
"term": form.Term,
|
||||
"dictionary": form.Dictionary,
|
||||
"fields": trans.Fields,
|
||||
"entries": trans.Entries,
|
||||
"suggestions": trans.Suggestions,
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user