From 66f9811151cbc0ebba237e010aa7f81734c78b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 27 Apr 2015 15:40:16 +0200 Subject: [PATCH 1/2] handle case where the given language is unknown - refs #15794 --- core/command/l10n/createjs.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/command/l10n/createjs.php b/core/command/l10n/createjs.php index 0411c2f01d97..20ce288e8be6 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); From aa2bd28a6a7f3b59eb1dd57a22e8aa4f8e1cab2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 27 Apr 2015 16:34:58 +0200 Subject: [PATCH 2/2] fix typo --- core/command/l10n/createjs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/command/l10n/createjs.php b/core/command/l10n/createjs.php index 20ce288e8be6..78f3229b1799 100644 --- a/core/command/l10n/createjs.php +++ b/core/command/l10n/createjs.php @@ -128,7 +128,7 @@ private function loadTranslations($path, $lang) { $TRANSLATIONS = array(); $PLURAL_FORMS = ''; if (!file_exists($phpFile)) { - throw new UnexpectedValueException("Php translation file <$phpFile> does not exist."); + throw new UnexpectedValueException("PHP translation file <$phpFile> does not exist."); } require $phpFile;