Skip to content

Commit

Permalink
Merge pull request #15892 from owncloud/fix-failed-require-in-l10n-cr…
Browse files Browse the repository at this point in the history
…eatejs

handle case where the given language is unknown - refs #15794
  • Loading branch information
DeepDiver1975 committed Apr 28, 2015
2 parents de8c15e + aa2bd28 commit 557b4a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/command/l10n/createjs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 557b4a2

Please sign in to comment.