mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 11:18:02 +08:00
19 lines
270 B
Go
19 lines
270 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/i18n/gi18n"
|
|
)
|
|
|
|
func main() {
|
|
t := gi18n.New()
|
|
t.SetLanguage("ja")
|
|
err := t.SetPath("./i18n-file")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(t.Translate(`hello`))
|
|
fmt.Println(t.Translate(`{#hello}{#world}!`))
|
|
}
|