tpl: Make it more clear on missing language string
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 9 Sep 2016 19:21:16 +0000 (21:21 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 9 Sep 2016 19:21:16 +0000 (21:21 +0200)
tpl/template_i18n.go

index 7abe29980f40efd607d775d869bd9218a7799d44..b973f4cd03f3701f80c9d1b47cfb54cd5df70433 100644 (file)
@@ -78,7 +78,9 @@ func SetI18nTfuncs(bndl *bundle.Bundle) {
                                i18nWarningLogger.Printf("i18n|MISSING_TRANSLATION|%s|%s", currentLang, translationID)
                        }
                        if defaultT != nil {
-                               return defaultT(translationID, args...)
+                               if translated := defaultT(translationID, args...); translated != translationID {
+                                       return translated
+                               }
                        }
                        return fmt.Sprintf("[i18n] %s", translationID)
                }