瀏覽代碼

Raise error if translation not found

shalvah 2 年之前
父節點
當前提交
ce98875b94
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/Tools/Utils.php

+ 5 - 0
src/Tools/Utils.php

@@ -367,6 +367,11 @@ class Utils
             $translation = trans($key, $replace, 'en');
         }
 
+
+        if ($translation === $key) {
+            throw new \Exception("Translation not found for $key. You can add a translation for this in your `lang/scribe.php`, but this is likely a problem with the package. Please open an issue.");
+        }
+
         return $translation;
     }
 }