diff --git a/module/CLI/lang/es.mo b/module/CLI/lang/es.mo
index 002ecddd..8c24a7b4 100644
Binary files a/module/CLI/lang/es.mo and b/module/CLI/lang/es.mo differ
diff --git a/module/CLI/lang/es.po b/module/CLI/lang/es.po
index 0f84f96d..2af67aaa 100644
--- a/module/CLI/lang/es.po
+++ b/module/CLI/lang/es.po
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Shlink 1.0\n"
-"POT-Creation-Date: 2016-07-21 15:40+0200\n"
-"PO-Revision-Date: 2016-07-21 15:41+0200\n"
+"POT-Creation-Date: 2016-07-21 15:48+0200\n"
+"PO-Revision-Date: 2016-07-21 15:49+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es_ES\n"
@@ -96,3 +96,19 @@ msgstr "Has alcanzado la última página"
msgid "Continue with page"
msgstr "Continuar con la página"
+
+msgid "Processes visits where location is not set yet"
+msgstr "Procesa las visitas donde la localización no ha sido establecida aún"
+
+msgid "Processing IP"
+msgstr "Procesando IP"
+
+msgid "Ignored localhost address"
+msgstr "Ignorada IP de localhost"
+
+#, php-format
+msgid "Address located at \"%s\""
+msgstr "Dirección localizada en \"%s\""
+
+msgid "Finished processing all IPs"
+msgstr "Finalizado el procesado de todas las IPs"
diff --git a/module/CLI/src/Command/ProcessVisitsCommand.php b/module/CLI/src/Command/ProcessVisitsCommand.php
index 19692e85..e9f95a7b 100644
--- a/module/CLI/src/Command/ProcessVisitsCommand.php
+++ b/module/CLI/src/Command/ProcessVisitsCommand.php
@@ -11,6 +11,7 @@ use Shlinkio\Shlink\Core\Service\VisitServiceInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Zend\I18n\Translator\TranslatorInterface;
class ProcessVisitsCommand extends Command
{
@@ -24,25 +25,36 @@ class ProcessVisitsCommand extends Command
* @var IpLocationResolverInterface
*/
private $ipLocationResolver;
+ /**
+ * @var TranslatorInterface
+ */
+ private $translator;
/**
* ProcessVisitsCommand constructor.
* @param VisitServiceInterface|VisitService $visitService
* @param IpLocationResolverInterface|IpLocationResolver $ipLocationResolver
+ * @param TranslatorInterface $translator
*
- * @Inject({VisitService::class, IpLocationResolver::class})
+ * @Inject({VisitService::class, IpLocationResolver::class, "translator"})
*/
- public function __construct(VisitServiceInterface $visitService, IpLocationResolverInterface $ipLocationResolver)
- {
- parent::__construct(null);
+ public function __construct(
+ VisitServiceInterface $visitService,
+ IpLocationResolverInterface $ipLocationResolver,
+ TranslatorInterface $translator
+ ) {
$this->visitService = $visitService;
$this->ipLocationResolver = $ipLocationResolver;
+ $this->translator = $translator;
+ parent::__construct(null);
}
public function configure()
{
$this->setName('visit:process')
- ->setDescription('Processes visits where location is not set already');
+ ->setDescription(
+ $this->translator->translate('Processes visits where location is not set yet')
+ );
}
public function execute(InputInterface $input, OutputInterface $output)
@@ -51,9 +63,11 @@ class ProcessVisitsCommand extends Command
foreach ($visits as $visit) {
$ipAddr = $visit->getRemoteAddr();
- $output->write(sprintf('Processing IP %s', $ipAddr));
+ $output->write(sprintf('%s %s', $this->translator->translate('Processing IP'), $ipAddr));
if ($ipAddr === self::LOCALHOST) {
- $output->writeln(' (Ignored localhost address)');
+ $output->writeln(
+ sprintf(' (%s)', $this->translator->translate('Ignored localhost address'))
+ );
continue;
}
@@ -63,12 +77,15 @@ class ProcessVisitsCommand extends Command
$location->exchangeArray($result);
$visit->setVisitLocation($location);
$this->visitService->saveVisit($visit);
- $output->writeln(sprintf(' (Address located at "%s")', $location->getCityName()));
+ $output->writeln(sprintf(
+ ' (' . $this->translator->translate('Address located at "%s"') . ')',
+ $location->getCityName()
+ ));
} catch (WrongIpException $e) {
continue;
}
}
- $output->writeln('Finished processing all IPs');
+ $output->writeln($this->translator->translate('Finished processing all IPs'));
}
}