diff --git a/bin/install b/bin/install index d83df5f6..0d8dc72c 100755 --- a/bin/install +++ b/bin/install @@ -1,5 +1,6 @@ #!/usr/bin/env php [ 'locale' => Common\env('CLI_LOCALE', 'en'), 'commands' => [ - Command\Shortcode\GenerateShortcodeCommand::NAME => Command\Shortcode\GenerateShortcodeCommand::class, - Command\Shortcode\ResolveUrlCommand::NAME => Command\Shortcode\ResolveUrlCommand::class, - Command\Shortcode\ListShortcodesCommand::NAME => Command\Shortcode\ListShortcodesCommand::class, - Command\Shortcode\GetVisitsCommand::NAME => Command\Shortcode\GetVisitsCommand::class, - Command\Shortcode\GeneratePreviewCommand::NAME => Command\Shortcode\GeneratePreviewCommand::class, - Command\Shortcode\DeleteShortCodeCommand::NAME => Command\Shortcode\DeleteShortCodeCommand::class, + Command\ShortUrl\GenerateShortUrlCommand::NAME => Command\ShortUrl\GenerateShortUrlCommand::class, + Command\ShortUrl\ResolveUrlCommand::NAME => Command\ShortUrl\ResolveUrlCommand::class, + Command\ShortUrl\ListShortUrlsCommand::NAME => Command\ShortUrl\ListShortUrlsCommand::class, + Command\ShortUrl\GetVisitsCommand::NAME => Command\ShortUrl\GetVisitsCommand::class, + Command\ShortUrl\GeneratePreviewCommand::NAME => Command\ShortUrl\GeneratePreviewCommand::class, + Command\ShortUrl\DeleteShortUrlCommand::NAME => Command\ShortUrl\DeleteShortUrlCommand::class, Command\Visit\ProcessVisitsCommand::NAME => Command\Visit\ProcessVisitsCommand::class, diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index 065c720c..f6f441c6 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -17,12 +17,12 @@ return [ 'factories' => [ Application::class => ApplicationFactory::class, - Command\Shortcode\GenerateShortcodeCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\ResolveUrlCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\ListShortcodesCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\GetVisitsCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\GeneratePreviewCommand::class => ConfigAbstractFactory::class, - Command\Shortcode\DeleteShortCodeCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GenerateShortUrlCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\ResolveUrlCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\ListShortUrlsCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GetVisitsCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\GeneratePreviewCommand::class => ConfigAbstractFactory::class, + Command\ShortUrl\DeleteShortUrlCommand::class => ConfigAbstractFactory::class, Command\Visit\ProcessVisitsCommand::class => ConfigAbstractFactory::class, @@ -41,24 +41,24 @@ return [ ], ConfigAbstractFactory::class => [ - Command\Shortcode\GenerateShortcodeCommand::class => [ + Command\ShortUrl\GenerateShortUrlCommand::class => [ Service\UrlShortener::class, 'translator', 'config.url_shortener.domain', ], - Command\Shortcode\ResolveUrlCommand::class => [Service\UrlShortener::class, 'translator'], - Command\Shortcode\ListShortcodesCommand::class => [ + Command\ShortUrl\ResolveUrlCommand::class => [Service\UrlShortener::class, 'translator'], + Command\ShortUrl\ListShortUrlsCommand::class => [ Service\ShortUrlService::class, 'translator', 'config.url_shortener.domain', ], - Command\Shortcode\GetVisitsCommand::class => [Service\VisitsTracker::class, 'translator'], - Command\Shortcode\GeneratePreviewCommand::class => [ + Command\ShortUrl\GetVisitsCommand::class => [Service\VisitsTracker::class, 'translator'], + Command\ShortUrl\GeneratePreviewCommand::class => [ Service\ShortUrlService::class, PreviewGenerator::class, 'translator', ], - Command\Shortcode\DeleteShortCodeCommand::class => [ + Command\ShortUrl\DeleteShortUrlCommand::class => [ Service\ShortUrl\DeleteShortUrlService::class, 'translator', ], diff --git a/module/CLI/lang/es.mo b/module/CLI/lang/es.mo index 8492b939..c2ea3578 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 db1408e8..d662948f 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: 2018-09-15 17:57+0200\n" -"PO-Revision-Date: 2018-09-15 18:02+0200\n" +"POT-Creation-Date: 2018-09-16 18:36+0200\n" +"PO-Revision-Date: 2018-09-16 18:37+0200\n" "Last-Translator: Alejandro Celaya \n" "Language-Team: \n" "Language: es_ES\n" @@ -83,8 +83,8 @@ msgstr "Clave secreta: \"%s\"" msgid "Deletes a short URL" msgstr "Elimina una URL" -msgid "The short code to be deleted" -msgstr "El código corto a eliminar" +msgid "The short code for the short URL to be deleted" +msgstr "El código corto de la URL corta a eliminar" msgid "" "Ignores the safety visits threshold check, which could make short URLs with " @@ -135,9 +135,8 @@ msgstr " ¡Correcto!" msgid "Error" msgstr "Error" -msgid "Generates a short code for provided URL and returns the short URL" -msgstr "" -"Genera un código corto para la URL proporcionada y devuelve la URL acortada" +msgid "Generates a short URL for provided long URL and returns it" +msgstr "Genera una URL corta para la URL larga proporcionada y la devuelve" msgid "The long URL to parse" msgstr "La URL larga a procesar" @@ -268,8 +267,8 @@ msgstr "Número de visitas" msgid "Tags" msgstr "Etiquetas" -msgid "Short codes properly listed" -msgstr "Códigos cortos correctamente listados" +msgid "Short URLs properly listed" +msgstr "URLs cortas listadas correctamente" msgid "Continue with page" msgstr "Continuar con la página" diff --git a/module/CLI/src/Command/Config/GenerateCharsetCommand.php b/module/CLI/src/Command/Config/GenerateCharsetCommand.php index caa64c28..c7287f7f 100644 --- a/module/CLI/src/Command/Config/GenerateCharsetCommand.php +++ b/module/CLI/src/Command/Config/GenerateCharsetCommand.php @@ -28,7 +28,7 @@ class GenerateCharsetCommand extends Command public function configure() { $this->setName(self::NAME) - ->setDescription(sprintf($this->translator->translate( + ->setDescription(\sprintf($this->translator->translate( 'Generates a character set sample just by shuffling the default one, "%s". ' . 'Then it can be set in the SHORTCODE_CHARS environment variable' ), UrlShortener::DEFAULT_CHARS)); diff --git a/module/CLI/src/Command/Install/InstallCommand.php b/module/CLI/src/Command/Install/InstallCommand.php index fbd36fe4..e3ed030c 100644 --- a/module/CLI/src/Command/Install/InstallCommand.php +++ b/module/CLI/src/Command/Install/InstallCommand.php @@ -102,7 +102,7 @@ class InstallCommand extends Command $this->io->writeln([ 'Welcome to Shlink!!', - 'This will guide you through the installation process.', + 'This tool will guide you through the installation process.', ]); // Check if a cached config file exists and drop it if so diff --git a/module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php similarity index 92% rename from module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php rename to module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php index f02750a1..50fed1c4 100644 --- a/module/CLI/src/Command/Shortcode/DeleteShortCodeCommand.php +++ b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php @@ -1,7 +1,7 @@ addArgument( 'shortCode', InputArgument::REQUIRED, - $this->translator->translate('The short code to be deleted') + $this->translator->translate('The short code for the short URL to be deleted') ) ->addOption( 'ignore-threshold', diff --git a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php similarity index 93% rename from module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php rename to module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php index e777b331..3b41eb44 100644 --- a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php +++ b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php @@ -1,7 +1,7 @@ setName(self::NAME) ->setAliases(self::ALIASES) ->setDescription( - $this->translator->translate('Generates a short code for provided URL and returns the short URL') + $this->translator->translate('Generates a short URL for provided long URL and returns it') ) ->addArgument('longUrl', InputArgument::REQUIRED, $this->translator->translate('The long URL to parse')) ->addOption( diff --git a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php similarity index 95% rename from module/CLI/src/Command/Shortcode/GetVisitsCommand.php rename to module/CLI/src/Command/ShortUrl/GetVisitsCommand.php index b27b6962..373b9169 100644 --- a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php +++ b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php @@ -1,7 +1,7 @@ isLastPage($result)) { $continue = false; - $io->success($this->translator->translate('Short codes properly listed')); + $io->success($this->translator->translate('Short URLs properly listed')); } else { $continue = $io->confirm( \sprintf($this->translator->translate('Continue with page') . ' %s?', $page), diff --git a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php similarity index 94% rename from module/CLI/src/Command/Shortcode/ResolveUrlCommand.php rename to module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php index b4a8394f..57f50a79 100644 --- a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php +++ b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php @@ -1,7 +1,7 @@ add($command); - $app->setDefaultCommand($command->getName()); + $app->setDefaultCommand($command->getName(), true); return $app; } diff --git a/module/CLI/test/Command/Shortcode/DeleteShortCodeCommandTest.php b/module/CLI/test/Command/ShortUrl/DeleteShortCodeCommandTest.php similarity index 94% rename from module/CLI/test/Command/Shortcode/DeleteShortCodeCommandTest.php rename to module/CLI/test/Command/ShortUrl/DeleteShortCodeCommandTest.php index e74b16b2..8d326758 100644 --- a/module/CLI/test/Command/Shortcode/DeleteShortCodeCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/DeleteShortCodeCommandTest.php @@ -1,12 +1,12 @@ service = $this->prophesize(DeleteShortUrlServiceInterface::class); - $command = new DeleteShortCodeCommand($this->service->reveal(), Translator::factory([])); + $command = new DeleteShortUrlCommand($this->service->reveal(), Translator::factory([])); $app = new Application(); $app->add($command); diff --git a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php rename to module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php index ee63a378..de62f193 100644 --- a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php @@ -1,12 +1,12 @@ urlShortener = $this->prophesize(UrlShortener::class); - $command = new GenerateShortcodeCommand($this->urlShortener->reveal(), Translator::factory([]), [ + $command = new GenerateShortUrlCommand($this->urlShortener->reveal(), Translator::factory([]), [ 'schema' => 'http', 'hostname' => 'foo.com', ]); diff --git a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php rename to module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php index 4035de78..54ce2f6f 100644 --- a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php @@ -1,12 +1,12 @@ shortUrlService = $this->prophesize(ShortUrlServiceInterface::class); $app = new Application(); - $command = new ListShortcodesCommand($this->shortUrlService->reveal(), Translator::factory([]), []); + $command = new ListShortUrlsCommand($this->shortUrlService->reveal(), Translator::factory([]), []); $app->add($command); $this->commandTester = new CommandTester($command); } diff --git a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php similarity index 96% rename from module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php rename to module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php index dfa2e483..b5e7aff2 100644 --- a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php @@ -1,11 +1,11 @@