gf/.example/i18n/gi18n/gi18n-dir.go

19 lines
269 B
Go
Raw Normal View History

2019-08-31 18:04:12 +08:00
package main
import (
"fmt"
2019-09-01 00:30:01 +08:00
"github.com/gogf/gf/i18n/gi18n"
2019-08-31 18:04:12 +08:00
)
func main() {
t := gi18n.New()
t.SetLanguage("ja")
err := t.SetPath("./i18n-dir")
if err != nil {
panic(err)
}
fmt.Println(t.Translate(`hello`))
fmt.Println(t.Translate(`{#hello}{#world}!`))
2019-08-31 18:04:12 +08:00
}