mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 11:18:02 +08:00
19 lines
402 B
Go
19 lines
402 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
)
|
|
|
|
func main() {
|
|
g.I18n().SetPath("/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/.example/i18n/gi18n/i18n")
|
|
s := g.Server()
|
|
s.BindHandler("/", func(r *ghttp.Request) {
|
|
r.Response.WriteTplContent(`{#hello}{#world}!`, g.Map{
|
|
"I18nLanguage": r.Get("lang", "zh-CN"),
|
|
})
|
|
})
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|