Просмотр исходного кода

Raise error if translation not found

shalvah 1 год назад
Родитель
Сommit
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;
     }
 }