mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
21 lines
304 B
Go
21 lines
304 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/frame/g"
|
|
|
|
_ "github.com/gogf/gf/os/gres/testdata"
|
|
)
|
|
|
|
func main() {
|
|
m := g.I18n()
|
|
m.SetLanguage("ja")
|
|
err := m.SetPath("/i18n-dir")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(m.Translate(`hello`))
|
|
fmt.Println(m.Translate(`{#hello}{#world}!`))
|
|
}
|