1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-24 12:25:57 +00:00

i18n: expose the LoaderConfig from the main i18n instance and add an example

Signed-off-by: Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-10 05:17:03 +03:00
parent b77227a0f9
commit 777ef0cd3e
8 changed files with 134 additions and 23 deletions

View File

@@ -0,0 +1,17 @@
package main
import (
"testing"
"github.com/kataras/iris/v12/httptest"
)
func TestI18nLoaderFuncMap(t *testing.T) {
app := newApp()
e := httptest.New(t, app)
e.GET("/").Expect().Status(httptest.StatusOK).
Body().Equal("Hi 2 dogs")
e.GET("/").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
Body().Equal("Γειά 2 σκυλί")
}