mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 04:21:57 +00:00
formatting
Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
@@ -14,11 +14,12 @@ func newApp() *iris.Application {
|
||||
Languages: map[string]string{
|
||||
"en-US": "./locales/locale_en-US.ini",
|
||||
"el-GR": "./locales/locale_el-GR.ini",
|
||||
"zh-CN": "./locales/locale_zh-CN.ini"}})
|
||||
"zh-CN": "./locales/locale_zh-CN.ini",
|
||||
},
|
||||
})
|
||||
app.Use(globalLocale)
|
||||
|
||||
app.Get("/", func(ctx iris.Context) {
|
||||
|
||||
// it tries to find the language by:
|
||||
// ctx.Values().GetString("language")
|
||||
// if that was empty then
|
||||
@@ -47,7 +48,9 @@ func newApp() *iris.Application {
|
||||
URLParameter: "lang",
|
||||
Languages: map[string]string{
|
||||
"en-US": "./locales/locale_multi_first_en-US.ini, ./locales/locale_multi_second_en-US.ini",
|
||||
"el-GR": "./locales/locale_multi_first_el-GR.ini, ./locales/locale_multi_second_el-GR.ini"}})
|
||||
"el-GR": "./locales/locale_multi_first_el-GR.ini, ./locales/locale_multi_second_el-GR.ini",
|
||||
},
|
||||
})
|
||||
|
||||
app.Get("/multi", multiLocale, func(ctx iris.Context) {
|
||||
language := ctx.Values().GetString(ctx.Application().ConfigurationReadOnly().GetTranslateLanguageContextKey())
|
||||
|
||||
Reference in New Issue
Block a user