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

New: i18n pluralization and variables support and more...

fixes: #1649, #1648, #1641, #1650

relative to: #1597
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-29 19:19:19 +03:00
parent f224ded740
commit 4065819688
63 changed files with 2054 additions and 684 deletions

View File

@@ -0,0 +1,26 @@
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("/singular").Expect().Status(httptest.StatusOK).
Body().Equal("Hi 1 dog")
e.GET("/members").Expect().Status(httptest.StatusOK).
Body().Equal("There are 42 members registered")
e.GET("/").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
Body().Equal("Γειά 2 σκυλί")
e.GET("/other").Expect().Status(httptest.StatusOK).
Body().Equal("AccessLogClear: Clear Access Log\nTitle: Account Connections")
e.GET("/other").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
Body().Equal("AccessLogClear: Καθαρισμός Πρόσβαση στο αρχείο καταγραφής\nTitle: Λογαριασμός Συνδέσεις")
}