Skip to content

Commit 5f92475

Browse files
committed
Merry Christmas: version 12.1.3 released
Former-commit-id: d4c9538646b8c17b32bc49b911e1535bcfe55401
1 parent 0510077 commit 5f92475

File tree

8 files changed

+45
-42
lines changed

8 files changed

+45
-42
lines changed

HISTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
2121

2222
**How to upgrade**: Open your command-line and execute this command: `go get github.com/kataras/iris/v12@latest`.
2323

24+
# We, 25 December 2019 | v12.1.3
25+
26+
Fix [[BUG] [iris.Default] RegisterView](https://github.com/kataras/iris/issues/1410)
27+
2428
# Th, 19 December 2019 | v12.1.2
2529

2630
Fix [[BUG]Session works incorrectly when meets the multi-level TLDs](https://github.com/kataras/iris/issues/1407).

HISTORY_ES.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,9 @@ Los desarrolladores no están obligados a actualizar si realmente no lo necesita
2121

2222
**Cómo actualizar**: Abra su línea de comandos y ejecute este comando: `go get github.com/kataras/iris/v12@latest`.
2323

24-
# Th, 19 December 2019 | v12.1.2
24+
# We, 25 December 2019 | v12.1.3
2525

26-
Not translated yet, please navigate to the [english version](HISTORY.md#th-19-december-2019--v1212) instead.
27-
28-
# Mo, 16 December 2019 | v12.1.1
29-
30-
Not translated yet, please navigate to the [english version](HISTORY.md#mo-16-december-2019--v1211) instead.
31-
32-
# Fr, 13 December 2019 | v12.1.0
33-
34-
Not translated yet, please navigate to the [english version](HISTORY.md#fr-13-december-2019--v1210) instead.
26+
Not translated yet, please navigate to the [english version](HISTORY.md#we-25-december-2019--v1213) instead.
3527

3628
# Sábado, 26 de octubre 2019 | v12.0.0
3729

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ![](https://iris-go.com/images/santa.png) Merry Christmas everyone!
22

3-
![](https://iris-go.com/images/release.png) Iris version 12.1.2 has been [released](HISTORY.md#th-19-december-2019--v1212)!
3+
![](https://iris-go.com/images/release.png) Iris version 12.1.3 has been [released](HISTORY.md#we-25-december-2019--v1213)!
44

55
![](https://iris-go.com/images/cli.png) The official Iris Command Line Interface will soon be near you in 2020!
66

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.1.2:https://github.com/kataras/iris/releases/tag/v12.1.2
1+
12.1.3:https://github.com/kataras/iris/releases/tag/v12.1.3

_examples/apidoc/yaag/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.13
44

55
require (
66
github.com/betacraft/yaag v1.0.1-0.20191027021412-565f65e36090
7-
github.com/kataras/iris/v12 v12.1.2
7+
github.com/kataras/iris/v12 v12.1.3
88
)

_examples/websocket/socketio/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.13
44

55
require (
66
github.com/googollee/go-socket.io v1.4.3-0.20191109153049-7451e2f8c2e0 // indirect
7-
github.com/kataras/iris/v12 v12.1.2
7+
github.com/kataras/iris/v12 v12.1.3
88
)

doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Source code and other details for the project are available at GitHub:
3838
3939
Current Version
4040
41-
12.1.2
41+
12.1.3
4242
4343
Installation
4444

iris.go

+34-27
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
)
4040

4141
// Version is the current version number of the Iris Web Framework.
42-
const Version = "12.1.2"
42+
const Version = "12.1.3"
4343

4444
// HTTP status codes as registered with IANA.
4545
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.
@@ -154,7 +154,8 @@ type Application struct {
154154
// view engine
155155
view view.View
156156
// used for build
157-
builded bool
157+
builded bool
158+
defaultMode bool
158159

159160
mu sync.Mutex
160161
// Hosts contains a list of all servers (Host Supervisors) that this app is running on.
@@ -188,36 +189,14 @@ func New() *Application {
188189
return app
189190
}
190191

191-
// Default returns a new Application instance which preloads
192-
// html view engine on "./views" and
193-
// locales from "./locales/*/*" filepath glob pattern by current working directory.
192+
// Default returns a new Application instance which on build state registers
193+
// html view engine on "./views" and load locales from "./locales/*/*".
194194
// The return instance recovers on panics and logs the incoming http requests too.
195195
func Default() *Application {
196196
app := New()
197197
app.Use(recover.New())
198198
app.Use(requestLogger.New())
199-
200-
for _, s := range []string{"./locales/*/*", "./locales/*", "./translations"} {
201-
if _, err := os.Stat(s); os.IsNotExist(err) {
202-
continue
203-
}
204-
205-
if err := app.I18n.Load(s); err != nil {
206-
continue
207-
}
208-
209-
app.I18n.SetDefault("en-US")
210-
break
211-
}
212-
213-
for _, s := range []string{"./views", "./templates", "./web/views"} {
214-
if _, err := os.Stat(s); os.IsNotExist(err) {
215-
continue
216-
}
217-
218-
app.RegisterView(HTML(s, ".html"))
219-
break
220-
}
199+
app.defaultMode = true
221200

222201
return app
223202
}
@@ -860,6 +839,34 @@ func (app *Application) Build() error {
860839
app.builded = true
861840
rp.Err(app.APIBuilder.GetReporter())
862841

842+
if app.defaultMode { // the app.I18n and app.View will be not available until Build.
843+
if !app.I18n.Loaded() {
844+
for _, s := range []string{"./locales/*/*", "./locales/*", "./translations"} {
845+
if _, err := os.Stat(s); os.IsNotExist(err) {
846+
continue
847+
}
848+
849+
if err := app.I18n.Load(s); err != nil {
850+
continue
851+
}
852+
853+
app.I18n.SetDefault("en-US")
854+
break
855+
}
856+
}
857+
858+
if app.view.Len() == 0 {
859+
for _, s := range []string{"./views", "./templates", "./web/views"} {
860+
if _, err := os.Stat(s); os.IsNotExist(err) {
861+
continue
862+
}
863+
864+
app.RegisterView(HTML(s, ".html"))
865+
break
866+
}
867+
}
868+
}
869+
863870
if app.I18n.Loaded() {
864871
// {{ tr "lang" "key" arg1 arg2 }}
865872
app.view.AddFunc("tr", app.I18n.Tr)

0 commit comments

Comments
 (0)