diff --git a/core/command/l10n/createjs.php b/core/command/l10n/createjs.php index 0411c2f01d97..78f3229b1799 100644 --- a/core/command/l10n/createjs.php +++ b/core/command/l10n/createjs.php @@ -28,6 +28,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use UnexpectedValueException; class CreateJs extends Command { @@ -126,6 +127,9 @@ private function loadTranslations($path, $lang) { $phpFile = "$path/l10n/$lang.php"; $TRANSLATIONS = array(); $PLURAL_FORMS = ''; + if (!file_exists($phpFile)) { + throw new UnexpectedValueException("PHP translation file <$phpFile> does not exist."); + } require $phpFile; return array($TRANSLATIONS, $PLURAL_FORMS);