mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Locale setting for the Translator
This commit is contained in:
parent
1c4f003e76
commit
c6fa1e893e
@ -35,6 +35,7 @@ class DumpCommand extends ContainerAwareCommand
|
|||||||
$this->availableFormats[0]
|
$this->availableFormats[0]
|
||||||
)
|
)
|
||||||
->addOption('api-version', null, InputOption::VALUE_REQUIRED, 'The API version')
|
->addOption('api-version', null, InputOption::VALUE_REQUIRED, 'The API version')
|
||||||
|
->addOption('locale', null, InputOption::VALUE_REQUIRED, 'Locale for translation')
|
||||||
->addOption('view', '', InputOption::VALUE_OPTIONAL, '', ApiDoc::DEFAULT_VIEW)
|
->addOption('view', '', InputOption::VALUE_OPTIONAL, '', ApiDoc::DEFAULT_VIEW)
|
||||||
->addOption('no-sandbox', '', InputOption::VALUE_NONE)
|
->addOption('no-sandbox', '', InputOption::VALUE_NONE)
|
||||||
->setName('api:doc:dump')
|
->setName('api:doc:dump')
|
||||||
@ -58,6 +59,10 @@ class DumpCommand extends ContainerAwareCommand
|
|||||||
$formatter = $this->getContainer()->get(sprintf('nelmio_api_doc.formatter.%s_formatter', $format));
|
$formatter = $this->getContainer()->get(sprintf('nelmio_api_doc.formatter.%s_formatter', $format));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($input->hasOption('locale')) {
|
||||||
|
$this->getContainer()->get('translator')->setLocale($input->getOption('locale'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($input->getOption('no-sandbox') && 'html' === $format) {
|
if ($input->getOption('no-sandbox') && 'html' === $format) {
|
||||||
$formatter->setEnableSandbox(false);
|
$formatter->setEnableSandbox(false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user