소스 검색

Raise error if translation not found

shalvah 1 년 전
부모
커밋
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;
     }
 }