blob: d3e0db56d3d5c075a5db39609db96e87505d6e40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
{{ define "localeslist" }}
package localeslist
import (
"sync"
)
// LocaleFunc is the function to run in order to create
// a new instance of a given locale
type LocaleFunc func() locales.Translator
// LocaleMap is map of locale string to instance function
type LocaleMap map[string]LocaleFunc
var (
once sync.Once
localeMap LocaleMap
)
func init() {
once.Do(func(){
localeMap = map[string]LocaleFunc{
{{ . }}
}
})
}
// Map returns the map of locales to instance New function
func Map() LocaleMap {
return localeMap
}
{{ end }}
|