Переглянути джерело

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;
     }
 }