1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 04:51:56 +00:00

i18n: add 'tr' template function inside the translation files themselves

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-10 05:57:49 +03:00
parent 777ef0cd3e
commit a1f7f57922
4 changed files with 44 additions and 35 deletions

View File

@@ -32,8 +32,7 @@ func newApp() *iris.Application {
app.Get("/", func(ctx iris.Context) {
text := ctx.Tr("HiDogs", iris.Map{
"locale": ctx.GetLocale(),
"count": 2,
"count": 2,
}) // prints "Hi 2 dogs".
ctx.WriteString(text)
})