Fix gotext.GetD with unloaded domain

This commit is contained in:
draveness
2018-12-07 12:32:39 +08:00
parent 7b73c0d36b
commit 37bac2fe57
2 changed files with 39 additions and 0 deletions

View File

@@ -182,6 +182,11 @@ func GetND(dom, str, plural string, n int, vars ...interface{}) string {
// Return Translation
globalConfig.RLock()
if _, ok := globalConfig.storage.Domains[dom]; !ok {
globalConfig.storage.AddDomain(dom)
}
tr := globalConfig.storage.GetND(dom, str, plural, n, vars...)
globalConfig.RUnlock()