mirror of
https://github.com/nextcloud/server.git
synced 2024-08-23 17:57:31 +02:00
Merge pull request #15892 from owncloud/fix-failed-require-in-l10n-createjs
handle case where the given language is unknown - refs #15794
This commit is contained in:
commit
557b4a2cb0
@ -28,6 +28,7 @@ use Symfony\Component\Console\Command\Command;
|
|||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use UnexpectedValueException;
|
||||||
|
|
||||||
class CreateJs extends Command {
|
class CreateJs extends Command {
|
||||||
|
|
||||||
@ -126,6 +127,9 @@ class CreateJs extends Command {
|
|||||||
$phpFile = "$path/l10n/$lang.php";
|
$phpFile = "$path/l10n/$lang.php";
|
||||||
$TRANSLATIONS = array();
|
$TRANSLATIONS = array();
|
||||||
$PLURAL_FORMS = '';
|
$PLURAL_FORMS = '';
|
||||||
|
if (!file_exists($phpFile)) {
|
||||||
|
throw new UnexpectedValueException("PHP translation file <$phpFile> does not exist.");
|
||||||
|
}
|
||||||
require $phpFile;
|
require $phpFile;
|
||||||
|
|
||||||
return array($TRANSLATIONS, $PLURAL_FORMS);
|
return array($TRANSLATIONS, $PLURAL_FORMS);
|
||||||
|
Loading…
Reference in New Issue
Block a user