MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / init

Function init

resources/locale/locale.go:16–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14)
15
16func init() {
17 files, err := i18nDirs.ReadDir("i18n")
18 if err != nil {
19 panic(err)
20 }
21 var data []byte
22 for _, f := range files {
23 data, err = i18nDirs.ReadFile("i18n/" + f.Name())
24 if err != nil {
25 panic(err)
26 }
27
28 tmp := make(map[string]string)
29 err = json.Unmarshal(data, &tmp)
30 if err != nil {
31 panic(err)
32 }
33 key := strings.TrimSuffix(f.Name(), ".json")
34 pm3.I18nRegister(key, tmp)
35 }
36}

Callers

nothing calls this directly

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected