mirror of
https://github.com/kataras/iris.git
synced 2026-01-19 09:56:02 +00:00
update dependencies
This commit is contained in:
@@ -35,7 +35,7 @@ func newApp() *iris.Application {
|
||||
// This is why this one accepts both input and matched languages,
|
||||
// so the caller can be more expressful knowing those.
|
||||
// Defaults to nil.
|
||||
app.I18n.DefaultMessageFunc = func(langInput, langMatched, key string, args ...interface{}) string {
|
||||
app.I18n.DefaultMessageFunc = func(langInput, langMatched, key string, args ...any) string {
|
||||
msg := fmt.Sprintf("user language input: %s: matched as: %s: not found key: %s: args: %v", langInput, langMatched, key, args)
|
||||
app.Logger().Warn(msg)
|
||||
return msg
|
||||
@@ -83,7 +83,7 @@ func newApp() *iris.Application {
|
||||
app.Get("/templates", func(ctx iris.Context) {
|
||||
if err := ctx.View("index.html", iris.Map{
|
||||
"tr": ctx.Tr, // word, arguments... {call .tr "hi" "iris"}}
|
||||
"trUnsafe": func(message string, args ...interface{}) template.HTML {
|
||||
"trUnsafe": func(message string, args ...any) template.HTML {
|
||||
return template.HTML(ctx.Tr(message, args...))
|
||||
},
|
||||
}); err != nil {
|
||||
|
||||
@@ -169,7 +169,7 @@ func main() {
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
func tr(ctx iris.Context, key string, args ...interface{}) {
|
||||
func tr(ctx iris.Context, key string, args ...any) {
|
||||
translation := ctx.Tr(key, args...)
|
||||
ctx.Writef("<tr><td>%s</td><td>%s</td><td>%v</td></tr>\n", key, translation, args)
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ LocalVarsHouseCount.Text=She has 4 houses
|
||||
}
|
||||
}
|
||||
|
||||
func tr(ctx iris.Context, key string, args ...interface{}) {
|
||||
func tr(ctx iris.Context, key string, args ...any) {
|
||||
translation := ctx.Tr(key, args...)
|
||||
ctx.Writef("%s=%s\n", key, translation)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user