@@ -2,11 +2,12 @@ package revel
2
2
3
3
import (
4
4
"fmt"
5
- "github.com/robfig/config"
6
5
"os"
7
6
"path/filepath"
8
7
"regexp"
9
8
"strings"
9
+
10
+ "github.com/robfig/config"
10
11
)
11
12
12
13
const (
@@ -103,17 +104,20 @@ func getUnknownValueFormat() string {
103
104
func loadMessages (path string ) {
104
105
messages = make (map [string ]* config.Config )
105
106
106
- if error := filepath .Walk (path , loadMessageFile ); error != nil && ! os .IsNotExist (error ) {
107
- ERROR .Println ("Error reading messages files:" , error )
108
- }
109
-
110
107
// Read in messages from the modules
108
+ // Load the module messges first,
109
+ // so that it can be override in parent application
111
110
for _ , module := range Modules {
112
111
TRACE .Println ("Importing messages from " , filepath .Join (module .Path , messageFilesDirectory ))
113
- if error := filepath .Walk (filepath .Join (module .Path , messageFilesDirectory ), loadMessageFile ); error != nil && ! os .IsNotExist (error ) {
114
- ERROR .Println ("Error reading messages files:" , error )
112
+ if err := filepath .Walk (filepath .Join (module .Path , messageFilesDirectory ), loadMessageFile ); err != nil &&
113
+ ! os .IsNotExist (err ) {
114
+ ERROR .Println ("Error reading messages files from module:" , err )
115
115
}
116
116
}
117
+
118
+ if error := filepath .Walk (path , loadMessageFile ); error != nil && ! os .IsNotExist (error ) {
119
+ ERROR .Println ("Error reading messages files:" , error )
120
+ }
117
121
}
118
122
119
123
// Load a single message file
0 commit comments