mirror of
https://github.com/kataras/iris.git
synced 2026-01-26 05:15:56 +00:00
example: i18n: nested .ini template key-values
This commit is contained in:
@@ -46,7 +46,10 @@ func newApp() *iris.Application {
|
||||
}
|
||||
}
|
||||
|
||||
app.I18n.Load("./locales/*/*", "en-US", "el-GR")
|
||||
err := app.I18n.Load("./locales/*/*", "en-US", "el-GR")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
app.Get("/", func(ctx iris.Context) {
|
||||
text := ctx.Tr("HiDogs", iris.Map{
|
||||
@@ -69,5 +72,11 @@ func newApp() *iris.Application {
|
||||
ctx.WriteString(text)
|
||||
})
|
||||
|
||||
// showcases the other.ini translation file.
|
||||
app.Get("/other", func(ctx iris.Context) {
|
||||
ctx.Writef(`AccessLogClear: %s
|
||||
Title: %s`, ctx.Tr("debug.AccessLogClear"), ctx.Tr("user.connections.Title"))
|
||||
})
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user