All checks were successful
Build and publish the docker image / build (push) Successful in 1m2s
Signed-off-by: ngn <ngn@ngn.tf>
32 lines
717 B
Go
32 lines
717 B
Go
package extract
|
|
|
|
import "net/url"
|
|
|
|
type dictionary struct {
|
|
ShortName string
|
|
Name string
|
|
Url string
|
|
}
|
|
|
|
var Dicts []dictionary = []dictionary{
|
|
{ShortName: "EN-TR", Name: "Turkish - English", Url: "/turkish-english"},
|
|
{ShortName: "EN-DE", Name: "German - English", Url: "/german-english"},
|
|
{ShortName: "EN-ES", Name: "Spanish - English", Url: "/spanish-english"},
|
|
{ShortName: "EN-FR", Name: "French - English", Url: "/french-english"},
|
|
}
|
|
|
|
func find_dict(sn string) *dictionary {
|
|
for i := range Dicts {
|
|
if Dicts[i].ShortName == sn {
|
|
return &Dicts[i]
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (d *dictionary) Path(term string) string {
|
|
term_escaped := url.PathEscape(term)
|
|
return d.Url + "/" + term_escaped
|
|
}
|