Skip to content
Snippets Groups Projects
Commit 66f98111 authored by Thomas Müller's avatar Thomas Müller
Browse files

handle case where the given language is unknown - refs #15794

parent 3b541611
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ use Symfony\Component\Console\Command\Command;
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 @@ class CreateJs extends Command {
$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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment