From c6fa1e893e19290e2353e8dcbbddb923ea4f5699 Mon Sep 17 00:00:00 2001
From: Vitaliy Chesnokov <me@vitaliy-chesnokov.ru>
Date: Wed, 24 Apr 2019 13:06:08 +0300
Subject: [PATCH] Locale setting for the Translator

---
 Command/DumpCommand.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Command/DumpCommand.php b/Command/DumpCommand.php
index 59e204b..af5450c 100644
--- a/Command/DumpCommand.php
+++ b/Command/DumpCommand.php
@@ -35,6 +35,7 @@ class DumpCommand extends ContainerAwareCommand
                 $this->availableFormats[0]
             )
             ->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('no-sandbox', '', InputOption::VALUE_NONE)
             ->setName('api:doc:dump')
@@ -58,6 +59,10 @@ class DumpCommand extends ContainerAwareCommand
             $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) {
             $formatter->setEnableSandbox(false);
         }