File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,13 @@ func (l *locale) Tr(trKey string, trArgs ...interface{}) string {
138
138
if l .store .reloadMu != nil {
139
139
l .store .reloadMu .Lock ()
140
140
defer l .store .reloadMu .Unlock ()
141
+ }
142
+ msg , _ := l .tryTr (trKey , trArgs ... )
143
+ return msg
144
+ }
145
+
146
+ func (l * locale ) tryTr (trKey string , trArgs ... interface {}) (msg string , found bool ) {
147
+ if l .store .reloadMu != nil {
141
148
now := time .Now ()
142
149
if now .Sub (l .lastReloadCheckTime ) >= time .Second && l .sourceFileInfo != nil && l .sourceFileName != "" {
143
150
l .lastReloadCheckTime = now
@@ -150,11 +157,6 @@ func (l *locale) Tr(trKey string, trArgs ...interface{}) string {
150
157
}
151
158
}
152
159
}
153
- msg , _ := l .tryTr (trKey , trArgs ... )
154
- return msg
155
- }
156
-
157
- func (l * locale ) tryTr (trKey string , trArgs ... interface {}) (msg string , found bool ) {
158
160
trMsg := trKey
159
161
textIdx , ok := l .store .textIdxMap [trKey ]
160
162
if ok {
You can’t perform that action at this time.
0 commit comments