Fixed a bug
git-svn-id: file:///srv/svn/repo/mai/trunk@32 e410bdd4-646f-c54f-a7ce-fffcc4f439ae
This commit is contained in:
parent
5182de046a
commit
0f7330e9da
@ -277,6 +277,10 @@ func (_ *GoogleTranslate) Translate(text string, from, to string) (TranslationRe
|
||||
}
|
||||
}
|
||||
|
||||
if from == "auto" {
|
||||
from = ""
|
||||
}
|
||||
|
||||
return TranslationResult{
|
||||
SourceLanguage: from,
|
||||
Definitions: definitions,
|
||||
|
@ -35,7 +35,8 @@
|
||||
<select name="from" aria-label="Source language">
|
||||
{{range $code, $name := .SourceLanguages}}
|
||||
{{if and (eq $code "auto") $.SourceLanguage}}
|
||||
<option value="{{ $code }}" {{if eq $code $.From}}selected{{end}}>{{ $name }} ({{index $.SourceLanguages $.SourceLanguage}})</option>
|
||||
<option value="{{ $code }}" {{if eq $code $.From}}selected{{end}}>{{ $name }} ({{index
|
||||
$.SourceLanguages $.SourceLanguage}})</option>
|
||||
{{else }}
|
||||
<option value="{{ $code }}" {{if eq $code $.From}}selected{{end}}>{{ $name }}</option>
|
||||
{{end}}
|
||||
@ -126,7 +127,8 @@
|
||||
{{ range $word, $word_translations := $translations }}
|
||||
<li>
|
||||
<span class="syn_type">{{$word}}:</span>
|
||||
<span class="syn">{{ range $index, $element := $word_translations.words}}{{if $index}}, {{end}}{{$element}}{{end}}</span>
|
||||
<span class="syn">{{ range $index, $element := $word_translations.words}}{{if $index}},
|
||||
{{end}}{{$element}}{{end}}</span>
|
||||
<span class="syn_type">{{$word_translations.frequency}}</span>
|
||||
</li>
|
||||
<br>
|
||||
@ -138,6 +140,11 @@
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<br><br><br><br><br>
|
||||
<footer class="center">
|
||||
<a href="https://codeberg.org/ManeraKai/simplytranslate">Source Code</a>
|
||||
</footer>
|
||||
|
||||
<script src="/static/script.js"></script>
|
||||
</body>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user