mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
@@ -68,7 +68,9 @@ func (t Translator) initFuncs(bndl *bundle.Bundle) {
|
||||
currentLang := lang
|
||||
|
||||
t.translateFuncs[currentLang] = func(translationID string, args ...interface{}) string {
|
||||
tpMu.RLock()
|
||||
tFunc, err := bndl.Tfunc(currentLang)
|
||||
tpMu.RUnlock()
|
||||
if err != nil {
|
||||
jww.WARN.Printf("could not load translations for language %q (%s), will use default content language.\n", lang, err)
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ import (
|
||||
|
||||
// Unfortunately this needs to be global, see
|
||||
// https://github.com/nicksnyder/go-i18n/issues/82
|
||||
var tpMu sync.Mutex
|
||||
var tpMu sync.RWMutex
|
||||
|
||||
// TranslationProvider provides translation handling, i.e. loading
|
||||
// of bundles etc.
|
||||
|
Reference in New Issue
Block a user