1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

add support for the go standard embed tag for locale files

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-09-23 01:28:47 +03:00
parent fd1db640a0
commit 4cd0621018
14 changed files with 230 additions and 57 deletions

View File

@@ -0,0 +1,21 @@
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("Become a MEMBER")
e.GET("/title").Expect().Status(httptest.StatusOK).
Body().Equal("Account Connections")
e.GET("/").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
Body().Equal("Γίνε ΜΈΛΟΣ")
e.GET("/title").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
Body().Equal("Λογαριασμός Συνδέσεις")
}