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:
26
_examples/i18n/template/main_test.go
Normal file
26
_examples/i18n/template/main_test.go
Normal 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: Λογαριασμός Συνδέσεις")
|
||||
}
|
||||
Reference in New Issue
Block a user