diff options
author | Stefan Giehl <stefan@matomo.org> | 2019-01-21 18:44:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-21 18:44:35 +0300 |
commit | 7395c84d061505e5f05abf60cb6773d00cc650bf (patch) | |
tree | 29bba493753f017fca04a498f807b265f688a798 /plugins/Intl | |
parent | 892e6f175965b5d56df2f5546e1adf5a417f325a (diff) |
Improve/Fix translation commands (#13982)
Diffstat (limited to 'plugins/Intl')
-rw-r--r-- | plugins/Intl/Commands/GenerateIntl.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/Intl/Commands/GenerateIntl.php b/plugins/Intl/Commands/GenerateIntl.php index b7d199c290..1b781b5503 100644 --- a/plugins/Intl/Commands/GenerateIntl.php +++ b/plugins/Intl/Commands/GenerateIntl.php @@ -17,6 +17,7 @@ use Piwik\Filesystem; use Piwik\Http; use Piwik\Plugin\ConsoleCommand; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; /** @@ -34,6 +35,7 @@ class GenerateIntl extends ConsoleCommand protected function configure() { $this->setName('translations:generate-intl-data') + ->addOption('language', 'l', InputOption::VALUE_OPTIONAL, 'language that should be fetched') ->setDescription('Generates Intl-data for Piwik'); } @@ -58,7 +60,11 @@ class GenerateIntl extends ConsoleCommand protected function execute(InputInterface $input, OutputInterface $output) { - $piwikLanguages = \Piwik\Plugins\LanguagesManager\API::getInstance()->getAvailableLanguages(); + $matomoLanguages = \Piwik\Plugins\LanguagesManager\API::getInstance()->getAvailableLanguages(); + + if ($input->getOption('language')) { + $matomoLanguages = [$input->getOption('language')]; + } $aliasesUrl = 'https://raw.githubusercontent.com/unicode-cldr/cldr-core/master/supplemental/aliases.json'; $aliasesData = Http::fetchRemoteFile($aliasesUrl); @@ -69,7 +75,7 @@ class GenerateIntl extends ConsoleCommand $writePath = Filesystem::getPathToPiwikRoot() . '/plugins/Intl/lang/%s.json'; - foreach ($piwikLanguages AS $langCode) { + foreach ($matomoLanguages AS $langCode) { if ($langCode == 'dev') { continue; |