From 2d4d860542686e8fc4f38cbbdb6372f4d9b0e949 Mon Sep 17 00:00:00 2001 From: ArrayIterator Date: Mon, 16 Oct 2023 06:20:24 +0700 Subject: [PATCH] add bulk changes --- .../Aggregator/DatabaseAggregator.php | 2 +- src/Benchmark/Aggregator/EventAggregator.php | 2 +- src/Benchmark/Aggregator/KernelAggregator.php | 2 +- .../Aggregator/MiddlewareAggregator.php | 2 +- .../Aggregator/ServicesAggregator.php | 2 +- .../Middlewares/DebuggingMiddleware.php | 14 +- src/Benchmark/Waterfall.php | 60 +- src/ComposerCreateProject.php | 32 +- src/Console/Command/ApplicationCheck.php | 13 +- .../ApplicationChecker/CacheChecker.php | 37 +- .../ApplicationChecker/ConfigChecker.php | 71 +- .../ApplicationChecker/ContainerChecker.php | 8 +- .../ApplicationChecker/DependencyChecker.php | 30 +- .../ApplicationChecker/TranslatorChecker.php | 18 +- src/Console/Command/BuiltInWebServer.php | 131 +- src/Console/Command/ChecksumGenerator.php | 38 +- src/Console/Command/CommandGenerator.php | 85 +- src/Console/Command/ControllerGenerator.php | 79 +- src/Console/Command/DatabaseChecker.php | 345 +-- .../Command/DatabaseEventGenerator.php | 82 +- src/Console/Command/EntityGenerator.php | 80 +- src/Console/Command/MiddlewareGenerator.php | 82 +- src/Console/Command/ModuleGenerator.php | 95 +- src/Console/Command/SchedulerAction.php | 41 +- src/Console/Command/SchedulerGenerator.php | 93 +- .../Command/Traits/WriterHelperTrait.php | 5 +- src/Event/Interfaces/ManagerInterface.php | 14 + src/Event/Manager.php | 34 +- src/HttpKernel/Traits/HttpKernelInitTrait.php | 24 +- src/Lang/README.md | 3 + src/Lang/default.pot | 1790 ++++++++++++++++ src/Lang/id.po | 1855 +++++++++++++++++ src/Routing/AbstractController.php | 7 +- .../Abstracts/AbstractTemplateRule.php | 7 + .../Middlewares/TemplateLoaderMiddleware.php | 57 + src/Templates/Template.php | 4 +- src/Traits/Service/TranslatorTrait.php | 157 +- .../HtmlTraceAbleErrorRenderer.php | 54 +- src/View/Twig/TwigExtensions/Translator.php | 79 +- src/Web.php | 5 +- 40 files changed, 4863 insertions(+), 676 deletions(-) create mode 100644 src/Lang/README.md create mode 100644 src/Lang/default.pot create mode 100644 src/Lang/id.po create mode 100644 src/Templates/Middlewares/TemplateLoaderMiddleware.php diff --git a/src/Benchmark/Aggregator/DatabaseAggregator.php b/src/Benchmark/Aggregator/DatabaseAggregator.php index 0872fbb..7ddf2ad 100644 --- a/src/Benchmark/Aggregator/DatabaseAggregator.php +++ b/src/Benchmark/Aggregator/DatabaseAggregator.php @@ -22,6 +22,6 @@ public function getName(): string } $this->translated = true; return $this->name = ContainerHelper::use(TranslatorInterface::class) - ?->translate('Database', context: 'benchmark')??$this->name; + ?->translateContext('Database', 'benchmark')??$this->name; } } diff --git a/src/Benchmark/Aggregator/EventAggregator.php b/src/Benchmark/Aggregator/EventAggregator.php index 9a2401b..99f8e42 100644 --- a/src/Benchmark/Aggregator/EventAggregator.php +++ b/src/Benchmark/Aggregator/EventAggregator.php @@ -41,7 +41,7 @@ public function getName(): string } $this->translated = true; return $this->name = ContainerHelper::use(TranslatorInterface::class) - ?->translate('Event', context: 'benchmark')??$this->name; + ?->translateContext('Event', 'benchmark')??$this->name; } public function addBlacklistedGroup(string $name): void diff --git a/src/Benchmark/Aggregator/KernelAggregator.php b/src/Benchmark/Aggregator/KernelAggregator.php index 34d2121..b4ef75a 100644 --- a/src/Benchmark/Aggregator/KernelAggregator.php +++ b/src/Benchmark/Aggregator/KernelAggregator.php @@ -28,7 +28,7 @@ public function getName(): string } $this->translated = true; return $this->name = ContainerHelper::use(TranslatorInterface::class) - ?->translate('Kernel', context: 'benchmark')??$this->name; + ?->translateContext('Kernel', 'benchmark')??$this->name; } public function accepted(RecordInterface $record): bool diff --git a/src/Benchmark/Aggregator/MiddlewareAggregator.php b/src/Benchmark/Aggregator/MiddlewareAggregator.php index 3f67e72..50290e8 100644 --- a/src/Benchmark/Aggregator/MiddlewareAggregator.php +++ b/src/Benchmark/Aggregator/MiddlewareAggregator.php @@ -28,7 +28,7 @@ public function getName(): string } $this->translated = true; return $this->name = ContainerHelper::use(TranslatorInterface::class) - ?->translate('Middleware', context: 'benchmark')??$this->name; + ?->translateContext('Middleware', 'benchmark')??$this->name; } public function accepted(RecordInterface $record): bool diff --git a/src/Benchmark/Aggregator/ServicesAggregator.php b/src/Benchmark/Aggregator/ServicesAggregator.php index bdc7b34..f3e07d6 100644 --- a/src/Benchmark/Aggregator/ServicesAggregator.php +++ b/src/Benchmark/Aggregator/ServicesAggregator.php @@ -37,7 +37,7 @@ public function getName(): string } $this->translated = true; return $this->name = ContainerHelper::use(TranslatorInterface::class) - ?->translate('Service', context: 'benchmark')??$this->name; + ?->translateContext('Service', 'benchmark')??$this->name; } public function addAcceptedGroup(string $name): void diff --git a/src/Benchmark/Middlewares/DebuggingMiddleware.php b/src/Benchmark/Middlewares/DebuggingMiddleware.php index 66d7e43..d74291f 100644 --- a/src/Benchmark/Middlewares/DebuggingMiddleware.php +++ b/src/Benchmark/Middlewares/DebuggingMiddleware.php @@ -198,13 +198,13 @@ static function ($match) use ($waterfall, $darkMode) { $body .sprintf( "\n", - $this->translate('rendered time', context: 'benchmark'), + $this->translateContext('rendered time', 'benchmark'), $profiler->convertMicrotime($performanceOrigin), - $this->translate('memory usage', context: 'benchmark'), + $this->translateContext('memory usage', 'benchmark'), $memoryOrigin, - $this->translate('rendered time', context: 'benchmark'), + $this->translateContext('rendered time', 'benchmark'), $profiler->convertMicrotime($performanceEnd), - $this->translate('memory usage', context: 'benchmark'), + $this->translateContext('memory usage', 'benchmark'), Consolidation::sizeFormat(memory_get_usage(), 3), ) ) @@ -252,14 +252,14 @@ private function printPerformance(ResponseInterface $response): ResponseInterfac "\n", sprintf( '(%s: %s ms / %s: %s / %s: %s)', - $this->translate('rendered time', context: 'benchmark'), + $this->translateContext('rendered time', 'benchmark'), round( (microtime(true) * 1000 - $startTime * 1000), 4 ), - $this->translate('peak memory usage', context: 'benchmark'), + $this->translateContext('peak memory usage', 'benchmark'), Consolidation::sizeFormat(memory_get_peak_usage(), 3), - $this->translate('memory usage', context: 'benchmark'), + $this->translateContext('memory usage', 'benchmark'), Consolidation::sizeFormat(memory_get_usage(), 3) ) ); diff --git a/src/Benchmark/Waterfall.php b/src/Benchmark/Waterfall.php index 4dfeacb..322f740 100644 --- a/src/Benchmark/Waterfall.php +++ b/src/Benchmark/Waterfall.php @@ -281,7 +281,7 @@ public function createHtmlStructure(bool $showEmpty = false) : string $this->createOpenTag( 'span', [], - $this->translate('Memory', context: 'benchmark'), + $this->translateContext('Memory', 'benchmark'), true ) . $this->createOpenTag( @@ -295,9 +295,9 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate( + 'title' => $this->translateContext( 'Memory usage', - context: 'benchmark' + 'benchmark' ) ] ), @@ -311,9 +311,9 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate( + 'title' => $this->translateContext( 'Real memory usage', - context: 'benchmark' + 'benchmark' ) ] ), @@ -327,9 +327,9 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate( + 'title' => $this->translateContext( 'Peak memory usage', - context: 'benchmark' + 'benchmark' ) ] ), @@ -343,9 +343,9 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate( + 'title' => $this->translateContext( 'Real Peak memory usage', - context: 'benchmark' + 'benchmark' ) ] ), @@ -362,9 +362,9 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate( + 'title' => $this->translateContext( 'Benchmark memory usage', - context: 'benchmark' + 'benchmark' ) ] ), @@ -395,7 +395,7 @@ public function createHtmlStructure(bool $showEmpty = false) : string $this->createOpenTag( 'span', [], - $this->translate('Duration', context: 'benchmark'), + $this->translateContext('Duration', 'benchmark'), true ) . $this->createOpenTag( @@ -409,7 +409,7 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate('Total duration', context: 'benchmark') + 'title' => $this->translateContext('Total duration', 'benchmark') ] ), round(((microtime(true) * 1000) - $float), 2) .' ms', @@ -422,7 +422,7 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate('Benchmark duration', context: 'benchmark') + 'title' => $this->translateContext('Benchmark duration', 'benchmark') ] ), round($profilerDurations, 2) . ' ms', @@ -435,7 +435,7 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'info' ], [ - 'title' => $this->translate('Application rendering duration', context: 'benchmark') + 'title' => $this->translateContext('Application rendering duration', 'benchmark') ] ), round($firstRender, 2) . ' ms', @@ -451,7 +451,7 @@ public function createHtmlStructure(bool $showEmpty = false) : string $html .= $this->columnRow( 'item', [ - 'title' => $this->translate('Total Benchmark', context: 'benchmark') + 'title' => $this->translateContext('Total Benchmark', 'benchmark') ], ( $this->createOpenTag('span', [], 'Total', true) @@ -478,9 +478,9 @@ public function createHtmlStructure(bool $showEmpty = false) : string ['item', 'active'], [ 'data-target' => 'all', - 'title' => $this->translate('Benchmarks', context: 'benchmark') + 'title' => $this->translateContext('Benchmarks', 'benchmark') ], - $this->translate('Benchmarks', context: 'benchmark'), + $this->translateContext('Benchmarks', 'benchmark'), true ); foreach ($this->getProfiler()->getAggregators() as $key => $aggregator) { @@ -538,7 +538,7 @@ public function createHtmlStructure(bool $showEmpty = false) : string 'input', [ 'type' => 'search', - 'placeholder' => $this->translate('Filter', context: 'benchmark'), + 'placeholder' => $this->translateContext('Filter', 'benchmark'), 'autocomplete' => 'off', 'name' => 'waterfall-search', 'class' => [ @@ -627,7 +627,7 @@ public function createSection( $this->columnRow( ['item'], [], - $this->translate('NO BENCHMARKS', context: 'benchmark'), + $this->translateContext('NO BENCHMARKS', 'benchmark'), true ), true, @@ -805,17 +805,17 @@ public function createSection( ['item', 'item-group'], [ 'title' => !$aggregator ? sprintf( - $this->translate('Total Groups: %d', context: 'benchmark'), + $this->translateContext('Total Groups: %d', 'benchmark'), $groupCount - ) : sprintf($this->translate( + ) : sprintf($this->translateContext( 'Group : %s', - context: 'benchmark' + 'benchmark' ), $aggregator->getGroupName()) ], $this->createOpenTag( 'span', [], - $this->translate('Group', context: 'benchmark'), + $this->translateContext('Group', 'benchmark'), true ). ( !$aggregator @@ -834,14 +834,14 @@ public function createSection( ['item', 'item-memory'], [ 'title' => sprintf( - $this->translate('Total Memory: %s', context: 'benchmark'), + $this->translateContext('Total Memory: %s', 'benchmark'), Consolidation::sizeFormat($memoryUsage, 2) ) ], $this->createOpenTag( 'span', [], - $this->translate('Memory', context: 'benchmark'), + $this->translateContext('Memory', 'benchmark'), true ), true, @@ -852,9 +852,9 @@ public function createSection( ['item', 'item-duration'], [ 'title' => sprintf( - $this->translate( + $this->translateContext( 'Total Benchmarks Duration: %s', - context: 'benchmark' + 'benchmark' ), round($theDurations, 2) .' ms' ) @@ -862,7 +862,7 @@ public function createSection( $this->createOpenTag( 'span', [], - $this->translate('Duration', context: 'benchmark'), + $this->translateContext('Duration', 'benchmark'), true ), true, @@ -875,7 +875,7 @@ public function createSection( $this->createOpenTag( 'span', [], - $this->translate('Waterfall', context: 'benchmark'), + $this->translateContext('Waterfall', 'benchmark'), true ), true, diff --git a/src/ComposerCreateProject.php b/src/ComposerCreateProject.php index 8ad35a0..d8ca882 100644 --- a/src/ComposerCreateProject.php +++ b/src/ComposerCreateProject.php @@ -3,15 +3,18 @@ namespace ArrayAccess\TrayDigita; +use DirectoryIterator; use Exception; use function chmod; use function class_exists; +use function copy; use function dirname; use function file_exists; use function file_get_contents; use function file_put_contents; use function getcwd; use function in_array; +use function is_dir; use function is_link; use function preg_match; use function random_bytes; @@ -244,7 +247,7 @@ public static function composerDoCreateProject($event) 'app/Views/errors/404.twig' => <<<'TWIG' {% extends "base.twig" %} {% if title is not defined %} - {% set title = translate('404 page not found') %} + {% set title = __('404 page not found') %} {% endif %} {% block body %}
@@ -252,7 +255,7 @@ public static function composerDoCreateProject($event)

404

- {{ translate('The page you requested was not found.') }} + {{ __('The page you requested was not found.') }}
{% endblock %} @@ -262,7 +265,7 @@ public static function composerDoCreateProject($event) {% block body %}

500

-

{{ translate('Internal Server Error') }}

+

{{ __('Internal Server Error') }}

{{ exception.getMessage()|protect_path }} {% if (displayErrorDetails ?? null) %}
{{ exception.getTraceAsString()|protect_path }}
@@ -416,6 +419,29 @@ public static function composerDoCreateProject($event) chmod($path, 0744); } } + $langDir = $installDir . '/app/Languages'; + $consoleIO->write( + 'Copying language files', + true, + $consoleIO::VERBOSE + ); + foreach (new DirectoryIterator(__DIR__.'/Lang') as $directory) { + if ($directory->isDot()) { + continue; + } + if ($directory->isDir()) { + continue; + } + $ext = $directory->getExtension(); + if ($ext !== 'po' && $ext !== 'pot' && $ext !== 'mo') { + continue; + } + $baseName = $directory->getBasename(); + if (file_exists($langDir . DIRECTORY_SEPARATOR . $baseName)) { + continue; + } + copy($directory, $langDir . DIRECTORY_SEPARATOR . $baseName); + } // */ } } diff --git a/src/Console/Command/ApplicationCheck.php b/src/Console/Command/ApplicationCheck.php index ef54c0a..fcc7f80 100644 --- a/src/Console/Command/ApplicationCheck.php +++ b/src/Console/Command/ApplicationCheck.php @@ -53,15 +53,16 @@ protected function configure(): void ->setName('app:check') ->setAliases([]) ->setDescription( - $this->translate('Check & validate application.') + $this->translateContext('Check & validate application.', 'console') ) ->setDefinition([]) ->setHelp( sprintf( - $this->translate(<<<'EOT' -The %s help you to validate application. -This command show information about installed application services. -EOT), + $this->translateContext( + "The %s help you to validate application.\n" + . "This command show information about installed application services.", + 'console' + ), '%command.name%' ) ); @@ -91,7 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $manager = $this->getManager(); $output->writeln(sprintf( "%s", - $this->translate('Application Check') + $this->translateContext('Application Check', 'console') )); $output->writeln(''); diff --git a/src/Console/Command/ApplicationChecker/CacheChecker.php b/src/Console/Command/ApplicationChecker/CacheChecker.php index c2d08ce..5521a63 100644 --- a/src/Console/Command/ApplicationChecker/CacheChecker.php +++ b/src/Console/Command/ApplicationChecker/CacheChecker.php @@ -27,8 +27,9 @@ public function check(InputInterface $input, OutputInterface $output) : int if (!$container?->has(CacheItemPoolInterface::class)) { $this->writeDanger( $output, - $this->translate( - 'Can not get cache object from container' + $this->translateContext( + 'Can not get cache object from container', + 'console' ) ); return Command::FAILURE; @@ -38,8 +39,9 @@ public function check(InputInterface $input, OutputInterface $output) : int if (!$cache instanceof CacheItemPoolInterface) { $this->writeDanger( $output, - $this->translate( - 'Cache is not valid object from container' + $this->translateContext( + 'Cache is not valid object from container', + 'console' ), ); return Command::FAILURE; @@ -47,15 +49,18 @@ public function check(InputInterface $input, OutputInterface $output) : int } catch (Throwable $error) { $this->writeDanger( $output, - $this->translate('Cache object error') + $this->translateContext('Cache object error', 'console') ); $this->writeIndent( $output, sprintf( '%s [%s] %s', - $this->translate('Error:'), + $this->translateContext('Error:', 'console'), $error::class, - $error->getMessage()?:$this->translate('Unknown Error') + $error->getMessage()?:$this->translateContext( + 'Unknown Error', + 'console' + ) ), OutputInterface::VERBOSITY_VERBOSE ); @@ -65,8 +70,9 @@ public function check(InputInterface $input, OutputInterface $output) : int $this->write( $output, sprintf( - $this->translate( - 'Cache object is set [%s]' + $this->translateContext( + 'Cache object is set [%s]', + 'console' ), sprintf( '%s', @@ -85,9 +91,12 @@ public function check(InputInterface $input, OutputInterface $output) : int $output, sprintf( '%s [%s] %s', - $this->translate('Error:'), + $this->translateContext('Error:', 'console'), $error::class, - $error->getMessage()?:$this->translate('Unknown Error') + $error->getMessage()?:$this->translateContext( + 'Unknown Error', + 'console' + ) ), OutputInterface::VERBOSITY_VERBOSE ); @@ -99,7 +108,7 @@ public function check(InputInterface $input, OutputInterface $output) : int $output, sprintf( '- %s [%s]', - $this->translate('Adapter'), + $this->translateContext('Adapter', 'console'), $adapter::class ), OutputInterface::VERBOSITY_VERBOSE @@ -108,7 +117,7 @@ public function check(InputInterface $input, OutputInterface $output) : int $output, sprintf( '- %s (%s)', - $this->translate('Default Lifetime'), + $this->translateContext('Default Lifetime', 'console'), $cache->getDefaultLifetime() ), OutputInterface::VERBOSITY_VERBOSE @@ -124,7 +133,7 @@ public function check(InputInterface $input, OutputInterface $output) : int $output, sprintf( '- %s [%s]', - $this->translate('Namespace'), + $this->translateContext('Namespace', 'console'), $namespace ), OutputInterface::VERBOSITY_VERBOSE diff --git a/src/Console/Command/ApplicationChecker/ConfigChecker.php b/src/Console/Command/ApplicationChecker/ConfigChecker.php index 12cca51..c9ca4e5 100644 --- a/src/Console/Command/ApplicationChecker/ConfigChecker.php +++ b/src/Console/Command/ApplicationChecker/ConfigChecker.php @@ -58,7 +58,7 @@ protected function validateEnvironment(InputInterface $input, OutputInterface $o if (!$config instanceof Config) { $this->writeDanger( $output, - $this->translate('Config environment is not set') + $this->translateContext('Config environment is not set', 'console') ); return Command::FAILURE; } @@ -68,10 +68,10 @@ protected function validateEnvironment(InputInterface $input, OutputInterface $o $this->write( $output, sprintf( - $this->translate('Debugging - error display [%s]'), + $this->translateContext('Debugging - error display [%s]', 'console'), $displayError - ? sprintf('%s', $this->translate('Enabled')) - : sprintf('%s', $this->translate('Disabled')) + ? sprintf('%s', $this->translateContext('Enabled', 'console')) + : sprintf('%s', $this->translateContext('Disabled', 'console')) ), $displayError ? self::MODE_WARNING : self::MODE_SUCCESS ); @@ -79,10 +79,10 @@ protected function validateEnvironment(InputInterface $input, OutputInterface $o $this->write( $output, sprintf( - $this->translate('Benchmark debug bar [%s]'), + $this->translateContext('Benchmark debug bar [%s]', 'console'), $debugBar - ? sprintf('%s', $this->translate('Enabled')) - : sprintf('%s', $this->translate('Disabled')) + ? sprintf('%s', $this->translateContext('Enabled', 'console')) + : sprintf('%s', $this->translateContext('Disabled', 'console')) ), $debugBar ? self::MODE_WARNING : self::MODE_SUCCESS ); @@ -90,10 +90,10 @@ protected function validateEnvironment(InputInterface $input, OutputInterface $o $this->write( $output, sprintf( - $this->translate('Benchmark profiling [%s]'), + $this->translateContext('Benchmark profiling [%s]', 'console'), $profiling - ? sprintf('%s', $this->translate('Enabled')) - : sprintf('%s', $this->translate('Disabled')) + ? sprintf('%s', $this->translateContext('Enabled', 'console')) + : sprintf('%s', $this->translateContext('Disabled', 'console')) ), $profiling ? self::MODE_WARNING : self::MODE_SUCCESS ); @@ -116,7 +116,7 @@ protected function validateEnvironment(InputInterface $input, OutputInterface $o sprintf( '%s', sprintf( - $this->translate('Benchmarks records (%d)'), + $this->translateContext('Benchmarks records (%d)', 'console'), $count ) ) @@ -126,7 +126,7 @@ protected function validateEnvironment(InputInterface $input, OutputInterface $o $output, sprintf( '%s [%s] (%d)', - $this->translate('Benchmarks group'), + $this->translateContext('Benchmarks group', 'console'), $groupName, $total ), @@ -187,13 +187,13 @@ protected function validatePath(InputInterface $input, OutputInterface $output) if (!$directory) { $this->write( $output, - $this->translate('App directory is not exists'), + $this->translateContext('App directory is not exists', 'console'), false ); } $this->write( $output, - $this->translate('Required Applications directory'), + $this->translateContext('Required Applications directory', 'console'), !$containFail ); @@ -205,7 +205,7 @@ protected function validatePath(InputInterface $input, OutputInterface $output) if (!$datum['valid']) { $additionalComment = sprintf( ' %s', - $this->translate('Storage directory is not writable') + $this->translateContext('Storage directory is not writable', 'console') ); } } @@ -220,7 +220,7 @@ protected function validatePath(InputInterface $input, OutputInterface $output) "%s %s %s%s", $status, $name, - $this->translate('directory'), + $this->translateContext('directory', 'console'), $directory ) ); @@ -247,19 +247,19 @@ protected function validateConfig(InputInterface $input, OutputInterface $output $problem = $kernel->getConfigError(); $message = match ($problem) { KernelInterface::CONFIG_NOT_FILE => sprintf( - $this->translate('Configuration file is not a valid file (%s)'), + $this->translateContext('Configuration file is not a valid file (%s)', 'console'), 'NOT_FILE' ), KernelInterface::CONFIG_NOT_ITERABLE => sprintf( - $this->translate('Configuration file is invalid (%s)'), + $this->translateContext('Configuration file is invalid (%s)', 'console'), 'NOT_ITERABLE' ), KernelInterface::CONFIG_EMPTY_FILE => sprintf( - $this->translate('Configuration file is empty (%s)'), + $this->translateContext('Configuration file is empty (%s)', 'console'), 'EMPTY_FILE' ), default => sprintf( - $this->translate('Configuration file does not exists (%s)'), + $this->translateContext('Configuration file does not exists (%s)', 'console'), 'UNAVAILABLE' ) }; @@ -271,7 +271,7 @@ protected function validateConfig(InputInterface $input, OutputInterface $output $output, sprintf( '[X] %s [%s]', - $this->translate('Configuration'), + $this->translateContext('Configuration', 'console'), $configFile ), OutputInterface::VERBOSITY_VERBOSE @@ -283,7 +283,7 @@ protected function validateConfig(InputInterface $input, OutputInterface $output if (!$config) { $this->writeDanger( $output, - $this->translate('Configuration file is not exists on container') + $this->translateContext('Configuration file is not exists on container', 'console') ); return Command::FAILURE; } @@ -292,8 +292,9 @@ protected function validateConfig(InputInterface $input, OutputInterface $output if (!$databaseConfig) { $this->writeDanger( $output, - $this->translate( - 'Configuration file does not contain database configuration' + $this->translateContext( + 'Configuration file does not contain database configuration', + 'console' ) ); return Command::FAILURE; @@ -308,8 +309,9 @@ protected function validateConfig(InputInterface $input, OutputInterface $output ) { $this->writeDanger( $output, - $this->translate( - 'Configuration file does not contain valid database configuration' + $this->translateContext( + 'Configuration file does not contain valid database configuration', + 'console' ) ); return Command::FAILURE; @@ -319,8 +321,9 @@ protected function validateConfig(InputInterface $input, OutputInterface $output if (!$security) { $this->writeDanger( $output, - $this->translate( - 'Configuration file does not contain security configuration' + $this->translateContext( + 'Configuration file does not contain security configuration', + 'console' ) ); return Command::FAILURE; @@ -329,8 +332,9 @@ protected function validateConfig(InputInterface $input, OutputInterface $output if (!$security->get('secret') || !$security->get('salt')) { $this->writeDanger( $output, - $this->translate( - 'Configuration file does not contain valid security configuration' + $this->translateContext( + 'Configuration file does not contain valid security configuration', + 'console' ) ); return Command::FAILURE; @@ -338,13 +342,16 @@ protected function validateConfig(InputInterface $input, OutputInterface $output $this->writeSuccess( $output, - $this->translate('Configuration file is exist & valid') + $this->translateContext( + 'Configuration file is exist & valid', + 'console' + ) ); $this->writeIndent( $output, sprintf( '[√] %s [%s]', - $this->translate('Configuration'), + $this->translateContext('Configuration', 'console'), $configFile ), OutputInterface::VERBOSITY_VERBOSE diff --git a/src/Console/Command/ApplicationChecker/ContainerChecker.php b/src/Console/Command/ApplicationChecker/ContainerChecker.php index 3236aee..56844ca 100644 --- a/src/Console/Command/ApplicationChecker/ContainerChecker.php +++ b/src/Console/Command/ApplicationChecker/ContainerChecker.php @@ -20,14 +20,14 @@ public function check(InputInterface $input, OutputInterface $output) : int if (!$container) { $this->writeDanger( $output, - $this->translate('Container object not set') + $this->translateContext('Container object not set', 'console') ); return Command::FAILURE; } $this->write( $output, sprintf( - $this->translate('Container object is set [%s]'), + $this->translateContext('Container object is set [%s]', 'console'), sprintf( '%s', $container::class @@ -43,7 +43,7 @@ public function check(InputInterface $input, OutputInterface $output) : int sprintf( '%s', sprintf( - $this->translate('Registered Container (%d)'), + $this->translateContext('Registered Container (%d)', 'console'), count($container->keys()) ), ), @@ -64,7 +64,7 @@ public function check(InputInterface $input, OutputInterface $output) : int sprintf( '%s', sprintf( - $this->translate('Registered Aliases (%d)'), + $this->translateContext('Registered Aliases (%d)', 'console'), count($container->getAliases()) ) ), diff --git a/src/Console/Command/ApplicationChecker/DependencyChecker.php b/src/Console/Command/ApplicationChecker/DependencyChecker.php index 082060b..2ca71c6 100644 --- a/src/Console/Command/ApplicationChecker/DependencyChecker.php +++ b/src/Console/Command/ApplicationChecker/DependencyChecker.php @@ -34,7 +34,7 @@ public function check(InputInterface $input, OutputInterface $output): int $output, sprintf( '%s %s%s', - $this->translate('Php version'), + $this->translateContext('Php version', 'console'), PHP_VERSION, PHP_EXTRA_VERSION ? '-'. PHP_EXTRA_VERSION : '' ), @@ -60,7 +60,7 @@ public function check(InputInterface $input, OutputInterface $output): int $notExists[$extension] = sprintf( '[x] %s %s', $extension, - $this->translate('extension is not exist') + $this->translateContext('extension is not exist', 'console') ); continue; } @@ -71,11 +71,11 @@ public function check(InputInterface $input, OutputInterface $output): int $exists[$extension] = sprintf( '%s %s %s %s', '[√]', - $this->translate('extension valid'), + $this->translateContext('extension valid', 'console'), $extension, $version ? sprintf( "%s [%s]", - $this->translate('with version'), + $this->translateContext('with version', 'console'), $version ) : '' ); @@ -83,7 +83,10 @@ public function check(InputInterface $input, OutputInterface $output): int if (empty($notExists)) { $this->writeSuccess( $output, - $this->translate('All required extensions are installed') + $this->translateContext( + 'All required extensions are installed', + 'console' + ) ); } else { $this->writeWarning( @@ -91,7 +94,10 @@ public function check(InputInterface $input, OutputInterface $output): int sprintf( '%s %s', count($notExists), - $this->translate('required extensions is not installed') + $this->translateContext( + 'required extensions is not installed', + 'console' + ) ), ); } @@ -134,15 +140,16 @@ public function check(InputInterface $input, OutputInterface $output): int '%s %s %s %s', '[√]', $extension, - $this->translate('extension installed'), + $this->translateContext('extension installed', 'console'), $version ? sprintf("with version [%s]", $version) : '' ); } if (empty($exists)) { $this->writeWarning( $output, - $this->translate( - 'No recommended extensions installed' + $this->translateContext( + 'No recommended extensions installed', + 'console' ) ); } else { @@ -151,10 +158,11 @@ public function check(InputInterface $input, OutputInterface $output): int sprintf( '%s %s', count($exists), - $this->translatePlural( + $this->translatePluralContext( 'recommended extension installed', 'recommended extensions installed', - count($exists) + count($exists), + 'console' ) ), true diff --git a/src/Console/Command/ApplicationChecker/TranslatorChecker.php b/src/Console/Command/ApplicationChecker/TranslatorChecker.php index 5935fdf..91841de 100644 --- a/src/Console/Command/ApplicationChecker/TranslatorChecker.php +++ b/src/Console/Command/ApplicationChecker/TranslatorChecker.php @@ -21,7 +21,10 @@ public function check(InputInterface $input, OutputInterface $output): int if (!$container?->has(TranslatorInterface::class)) { $this->writeDanger( $output, - $this->translate('Can not get translator object from container') + $this->translateContext( + 'Can not get translator object from container', + 'console' + ) ); return Command::FAILURE; } @@ -33,7 +36,10 @@ public function check(InputInterface $input, OutputInterface $output): int if (!$translator instanceof TranslatorInterface) { $this->writeDanger( $output, - $this->translate('Translator is not valid object from container') + $this->translateContext( + 'Translator is not valid object from container', + 'console' + ) ); return Command::FAILURE; } @@ -42,7 +48,7 @@ public function check(InputInterface $input, OutputInterface $output): int $output, sprintf( '%s [%s]', - $this->translate('Translator object is set'), + $this->translateContext('Translator object is set', 'console'), $translator::class ), true @@ -52,12 +58,12 @@ public function check(InputInterface $input, OutputInterface $output): int count($translator->getAdapters()) === 0 ? sprintf( '%s', - $this->translate('No Adapter Registered') + $this->translateContext('No Adapter Registered', 'console') ) : sprintf( '%s', sprintf( - $this->translate('Registered Adapters (%d)'), + $this->translateContext('Registered Adapters (%d)', 'console'), count($translator->getAdapters()) ) ), @@ -81,7 +87,7 @@ public function check(InputInterface $input, OutputInterface $output): int $output, sprintf( '%s [%s]', - $this->translate('Current Language'), + $this->translateContext('Current Language', 'console'), $translator->getLanguage() ), OutputInterface::VERBOSITY_VERBOSE diff --git a/src/Console/Command/BuiltInWebServer.php b/src/Console/Command/BuiltInWebServer.php index ac6e0d3..056fe56 100644 --- a/src/Console/Command/BuiltInWebServer.php +++ b/src/Console/Command/BuiltInWebServer.php @@ -86,20 +86,29 @@ protected function configure(): void ->setName('app:server') ->setAliases(['server']) ->setDescription( - $this->translate('Create temporary php builtin web server.') + $this->translateContext( + 'Create temporary php builtin web server.', + 'console' + ) )->setDefinition([ new InputOption( 'port', 'p', InputOption::VALUE_OPTIONAL, - $this->translate('Port number that used for listening server'), + $this->translateContext( + 'Port number that used for listening server', + 'console' + ), 'auto' ), new InputOption( 'host', 'H', InputOption::VALUE_OPTIONAL, - $this->translate('Host that used to listening server.'), + $this->translateContext( + 'Host that used to listening server.', + 'console' + ), '127.0.0.1', [ '127.0.0.1', @@ -111,33 +120,31 @@ protected function configure(): void 'index-file', 'i', InputOption::VALUE_OPTIONAL, - $this->translate('Public index.php file.') + $this->translateContext('Public index.php file.', 'console') ) ])->setHelp( sprintf( - $this->translate(<<<'EOT' -The %s help you to create temporary php builtin web server like: - - %s - -You can use %s - -Host accept local %s -Port accept range between %s -EOT), + $this->translateContext( + "The %s help you to create temporary php builtin web server like:\n\n" + . " %s\n\n" + . "You can use %s\n\n" + . "Host accept local %s\n" + . "Port accept range between %s", + 'console' + ), '%command.name%', 'php %command.full_name% --host=the_host --port=numeric_port', sprintf( 'cd /path/to/public && php -S [(string) hostname/IP]:[(integer) %s] index.php', - $this->translate('port number') + $this->translateContext('port number', 'console') ), sprintf( 'IPv4 & localhost [%s: 127.0.0.1]', - $this->translate('default') + $this->translateContext('default', 'console') ), sprintf( '1024 - 49151 [%s: 8000 or auto]', - $this->translate('default') + $this->translateContext('default', 'console') ) ) ); @@ -160,12 +167,15 @@ protected function execute(InputInterface $input, OutputInterface $output) : int $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( - $this->translate('Port is Invalid! option port must be numeric.') + $this->translateContext( + 'Port is Invalid! option port must be numeric.', + 'console' + ) ); return self::INVALID; } @@ -175,19 +185,28 @@ protected function execute(InputInterface $input, OutputInterface $output) : int $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( sprintf( - 'Port is Invalid! option port should not use: %s', - $port + $this->translateContext( + 'Port is Invalid! option port should not use: %s', + 'console' + ), + sprintf( + '%s', + $port + ) ) ); $output->writeln( sprintf( - $this->translate('Typically this port used by %s application.'), + $this->translateContext( + 'Typically this port used by %s application.', + 'console' + ), sprintf( '%s', self::BLACKLIST_PORT[$port] @@ -201,14 +220,15 @@ protected function execute(InputInterface $input, OutputInterface $output) : int $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( sprintf( - $this->translate( - 'Port is out of range! option port must be between: %s to %s' + $this->translateContext( + 'Port is out of range! option port must be between: %s to %s', + 'console' ), sprintf( '%d', @@ -233,13 +253,14 @@ protected function execute(InputInterface $input, OutputInterface $output) : int $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( - $this->translate( - 'Option host is invalid. Host only accept "localhost" and local IP address.' + $this->translateContext( + 'Option host is invalid. Host only accept "localhost" and local IP address.', + 'console' ) ); return self::INVALID; @@ -249,14 +270,15 @@ protected function execute(InputInterface $input, OutputInterface $output) : int $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( sprintf( - $this->translate( - 'Option host is invalid. IP %s is not a local IP address.' + $this->translateContext( + 'Option host is invalid. IP %s is not a local IP address.', + 'console' ), $host ) @@ -315,13 +337,14 @@ protected function doProcess( $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( - $this->translate( - 'Could not detect public root file.' + $this->translateContext( + 'Could not detect public root file.', + 'console' ) ); return self::FAILURE; @@ -331,13 +354,14 @@ protected function doProcess( $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( - $this->translate( - 'Public root file is not in application directory!' + $this->translateContext( + 'Public root file is not in application directory!', + 'console' ) ); return self::INVALID; @@ -347,13 +371,14 @@ protected function doProcess( $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( - $this->translate( - 'Could not detect php binary executable file.' + $this->translateContext( + 'Could not detect php binary executable file.', + 'console' ) ); return self::FAILURE; @@ -363,12 +388,12 @@ protected function doProcess( $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); $output->writeln( - $this->translate('Function [exec] is not exist') + $this->translateContext('Function [exec] is not exist', 'console') ); return self::FAILURE; } @@ -393,7 +418,7 @@ protected function doProcess( $progressBar->setFormat( sprintf( '%s [%%message%%] [%%bar%%] %%elapsed:6s%%', - $this->translate('Checking') + $this->translateContext('Checking', 'console') ) ); $usedPort = null; @@ -401,7 +426,7 @@ protected function doProcess( $progressBar->setMessage( sprintf( "%s : $p", - $this->translate('Port') + $this->translateContext('Port', 'console') ) ); $progressBar->advance(); @@ -429,7 +454,7 @@ protected function doProcess( $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); @@ -437,16 +462,18 @@ protected function doProcess( $port === 'auto' ? sprintf( sprintf( - $this->translate( - 'Can not determine port that can be used after doing %s tests' + $this->translateContext( + 'Can not determine port that can be used after doing %s tests', + 'console' ), '%d' ), count($ports) ) : sprintf( sprintf( - $this->translate( - 'Can not listening %s with port %s' + $this->translateContext( + 'Can not listening %s with port %s', + 'console' ), '%s', '%d' @@ -501,7 +528,7 @@ protected function doProcess( $output->writeln(''); $output->writeln( sprintf( - $this->translate('Press %s to exit.'), + $this->translateContext('Press %s to exit.', 'console'), 'Ctrl+C' ) ); @@ -528,7 +555,7 @@ protected function doProcess( $output->writeln(sprintf( '%s', sprintf( - $this->translate('Command %s ERROR!!'), + $this->translateContext('Command %s Error!', 'console'), $this->getName() ) )); diff --git a/src/Console/Command/ChecksumGenerator.php b/src/Console/Command/ChecksumGenerator.php index e65ea53..9e5357d 100644 --- a/src/Console/Command/ChecksumGenerator.php +++ b/src/Console/Command/ChecksumGenerator.php @@ -55,16 +55,18 @@ protected function configure(): void ->setName('app:generate:checksums') ->setAliases(['generate-checksums']) ->setDescription( - $this->translate( - 'Create list of core file checksums.' + $this->translateContext( + 'Create list of core file checksums.', + 'console' ) )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_OPTIONAL, - description: $this->translate( - 'Display checksums on terminal without writing to disk' + description: $this->translateContext( + 'Display checksums on terminal without writing to disk', + 'console' ), default: false, suggestedValues: ['sha1', 'md5'] @@ -72,9 +74,10 @@ protected function configure(): void ]) ->setHelp( sprintf( - $this->translate(<<<'EOT' -The %s creating checksum files on %s directory. -EOT), + $this->translateContext( + 'The %s creating checksum files on %s directory.', + 'console' + ), '%command.name%', 'checksum' ) @@ -114,8 +117,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$quiet && !$printOnly) { $output->writeln( sprintf( - $this->translate( - 'Files will be put in directory: %s' + $this->translateContext( + 'Files will be put in directory: %s', + 'console' ), sprintf( '%s', @@ -125,7 +129,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $answer = $input->isInteractive() ? $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext( + 'Are you sure to continue (Yes/No)?', + 'console' + ), null, static function ($e) { $e = !is_string($e) ? '' : $e; @@ -137,7 +144,10 @@ static function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -147,7 +157,7 @@ static function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; @@ -258,7 +268,7 @@ static function ($e) { '%s calculate %s files', sprintf( '%s', - $this->translate('Done!') + $this->translateContext('Done!', 'console') ), sprintf( '%d', @@ -270,7 +280,7 @@ static function ($e) { $output->writeln( sprintf( '%s: %s', - $this->translate('Source'), + $this->translateContext('Source', 'console'), $srcDirectory ) ); diff --git a/src/Console/Command/CommandGenerator.php b/src/Console/Command/CommandGenerator.php index 341006f..86500ac 100644 --- a/src/Console/Command/CommandGenerator.php +++ b/src/Console/Command/CommandGenerator.php @@ -76,23 +76,22 @@ protected function configure() : void ->setName('app:generate:command') ->setAliases(['generate-command']) ->setDescription( - $this->translate('Generate command class.') + $this->translateContext('Generate command class.', 'console') )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_NONE, - $this->translate('Print generated class file only') + $this->translateContext('Print generated class file only', 'console') ) ])->setHelp( sprintf( - $this->translate(<<translateContext( + "The %s help you to create %s object.\n\n" + . "Command will use prefix namespace with %s\n" + . "Command only support single class name.\n", + 'console' + ), '%command.name%', 'command', sprintf( @@ -172,13 +171,16 @@ protected function askClassName(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); return $io->ask( - $this->translate('Please enter command class name'), + $this->translateContext('Please enter command class name', 'console'), null, function ($name) { $definitions = $this->filterNames($name); if ($definitions === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid command class name!') + $this->translateContext( + 'Please enter valid command class name!', + 'console' + ) ); } $commandName = $definitions['identity']; @@ -186,8 +188,9 @@ function ($name) { if (!Consolidation::allowedClassName($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Command [%s] is invalid! class name contain reserved keyword!' + $this->translateContext( + 'Command [%s] is invalid! class name contain reserved keyword!', + 'console' ), $className ) @@ -196,8 +199,9 @@ function ($name) { if (count(explode('\\', $className)) > 1) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Command [%s] is invalid! Command only contain single class name, not namespaced!' + $this->translateContext( + 'Command [%s] is invalid! Command only contain single class name, not namespaced!', + 'console' ), $className ) @@ -206,8 +210,9 @@ function ($name) { if (strlen($commandName) > 128) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Command [%s] is too long! Must be less or equal 128 characters' + $this->translateContext( + 'Command [%s] is too long! Must be less or equal 128 characters', + 'console' ), $commandName ) @@ -216,7 +221,7 @@ function ($name) { if ($this->isFileExists($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate('Command [%s] exist'), + $this->translateContext('Command [%s] exist', 'console'), $this->commandNamespace . $className ) ); @@ -245,8 +250,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->commandDir) { $output->writeln( sprintf( - $this->translate( - '%s Could not detect command directory' + $this->translateContext( + '%s Could not detect command directory', + 'console' ), '[X]' ) @@ -258,8 +264,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$named && !$input->isInteractive()) { $output->writeln( sprintf( - $this->translate( - '%s generator only support in interactive mode' + $this->translateContext( + '%s generator only support in interactive mode', + 'console' ), '[X]' ) @@ -281,8 +288,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $name = 'app:console:'. strtolower($named['className']); $output->writeln( sprintf( - $this->translate( - 'Command Name : %s' + $this->translateContext( + 'Command Name : %s', + 'console' ), sprintf( '%s', @@ -293,8 +301,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $className = $this->commandNamespace . $named['className']; $output->writeln( sprintf( - $this->translate( - 'Command Class : %s' + $this->translateContext( + 'Command Class : %s', + 'console' ), sprintf( '%s', @@ -304,8 +313,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Command File : %s' + $this->translateContext( + 'Command File : %s', + 'console' ), sprintf( '%s', @@ -316,7 +326,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @noinspection DuplicatedCode */ $io = new SymfonyStyle($input, $output); $answer = !$input->isInteractive() || $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext('Are you sure to continue (Yes/No)?', 'console'), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -328,7 +338,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -347,8 +360,9 @@ function ($e) { if (!$status) { $output->writeln( sprintf( - $this->translate( - '%s Could not save command!' + $this->translateContext( + '%s Could not save command!', + 'console' ), '[X]' ) @@ -357,8 +371,9 @@ function ($e) { } $output->writeln( sprintf( - $this->translate( - '%s Command successfully created!' + $this->translateContext( + '%s Command successfully created!', + 'console' ), '[√]' ) @@ -368,7 +383,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; diff --git a/src/Console/Command/ControllerGenerator.php b/src/Console/Command/ControllerGenerator.php index dd68b0c..b8f80e2 100644 --- a/src/Console/Command/ControllerGenerator.php +++ b/src/Console/Command/ControllerGenerator.php @@ -76,32 +76,33 @@ protected function configure() : void ->setName('app:generate:controller') ->setAliases(['generate-controller']) ->setDescription( - $this->translate( - 'Generate controller class.' + $this->translateContext( + 'Generate controller class.', + context: 'console' ) )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_NONE, - $this->translate('Print generated class file only') + $this->translateContext('Print generated class file only', 'console') ) ])->setHelp( sprintf( - $this->translate(<<translateContext( + "The %s help you to create controller object.\n" + . "Controller will use prefix namespace with %s\n" + . "Character slash %s, hyphen %s and underscore %s\n" + . "Will converted into namespace separator", + 'console' + ), '%command.name%', sprintf('%s', $namespace), '[ / ]', '[ - ]', '[ _ ]' - ) + ), ); } @@ -156,20 +157,21 @@ protected function askClassName(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); return $io->ask( - $this->translate('Please enter controller name'), + $this->translateContext('Please enter controller name', 'console'), null, function ($name) { $className = $this->filterName($name); if ($className === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid controller name!') + $this->translateContext('Please enter valid controller name!', 'console') ); } if (count(explode('\\', $className)) > 5) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Controller [%s] is too long! Must be less or equal 5 namespaces' + $this->translateContext( + 'Controller [%s] is too long! Must be less or equal 5 namespaces', + 'console' ), $className ) @@ -178,8 +180,9 @@ function ($name) { if (!Consolidation::allowedClassName($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Controller [%s] is invalid! class name contain reserved keyword!' + $this->translateContext( + 'Controller [%s] is invalid! class name contain reserved keyword!', + 'console' ), $className ) @@ -188,7 +191,7 @@ function ($name) { if ($this->isFileExists($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate('Controller [%s] exist'), + $this->translateContext('Controller [%s] exist', 'console'), $this->controllerNameSpace . $className ) ); @@ -217,8 +220,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->controllerDir) { $output->writeln( sprintf( - $this->translate( - '%s Could not detect controller directory' + $this->translateContext( + '%s Could not detect controller directory', + 'console' ), '[X]' ) @@ -230,7 +234,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$name && !$input->isInteractive()) { $output->writeln( sprintf( - $this->translate('%s generator only support in interactive mode'), + $this->translateContext( + '%s generator only support in interactive mode', + 'console' + ), '[X]' ) ); @@ -250,7 +257,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln( sprintf( - $this->translate('Controller Name : %s'), + $this->translateContext('Controller Name : %s', 'console'), sprintf( '%s', $name @@ -260,8 +267,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $className = $this->controllerNameSpace . $name; $output->writeln( sprintf( - $this->translate( - 'Controller Class : %s' + $this->translateContext( + 'Controller Class : %s', + 'console' ), sprintf( '%s', @@ -271,7 +279,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate('Controller File : %s'), + $this->translateContext('Controller File : %s', 'console'), sprintf( '%s', $fileName @@ -281,7 +289,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @noinspection DuplicatedCode */ $io = new SymfonyStyle($input, $output); $answer = !$input->isInteractive() || $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext('Are you sure to continue (Yes/No)?', 'console'), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -293,8 +301,9 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate( - 'Please enter valid answer! (Yes / No)' + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' ) ); } @@ -312,8 +321,9 @@ function ($e) { if (!$status) { $output->writeln( sprintf( - $this->translate( - '%s Could not save controller!' + $this->translateContext( + '%s Could not save controller!', + 'console' ), '[X]' ) @@ -322,8 +332,9 @@ function ($e) { } $output->writeln( sprintf( - $this->translate( - '%s Controller successfully created!' + $this->translateContext( + '%s Controller successfully created!', + 'console' ), '[√]' ) @@ -333,7 +344,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; diff --git a/src/Console/Command/DatabaseChecker.php b/src/Console/Command/DatabaseChecker.php index bca5f64..c25db86 100644 --- a/src/Console/Command/DatabaseChecker.php +++ b/src/Console/Command/DatabaseChecker.php @@ -82,14 +82,17 @@ protected function configure(): void ->setName('app:db') ->setAliases(['app:database']) ->setDescription( - $this->translate('Check & validate database.') + $this->translateContext('Check & validate database.', 'console') ) ->setDefinition([ new InputOption( $this->schemaCommand, 's', InputOption::VALUE_NONE, - $this->translate('Validate changed / difference about database schema'), + $this->translateContext( + 'Validate changed / difference about database schema', + 'console' + ), null ), new InputOption( @@ -97,7 +100,10 @@ protected function configure(): void 'p', InputOption::VALUE_NONE, sprintf( - $this->translate('Print sql query create schema (should execute with %s command)'), + $this->translateContext( + 'Print sql query create schema (should execute with %s command)', + 'console' + ), sprintf( '--%s', $this->schemaCommand @@ -110,8 +116,9 @@ protected function configure(): void 'd', InputOption::VALUE_NONE, sprintf( - $this->translate( - 'Dump create schema (should execute with %s & %s command)' + $this->translateContext( + 'Dump create schema (should execute with %s & %s command)', + 'console' ), sprintf( '--%s', @@ -129,8 +136,9 @@ protected function configure(): void 'x', InputOption::VALUE_NONE, sprintf( - $this->translate( - 'Execute query sql that from new schema into database (should execute with %s command)' + $this->translateContext( + 'Execute query sql that from new schema into database (should execute with %s command)', + 'console' ), sprintf( '--%s', @@ -144,8 +152,9 @@ protected function configure(): void 'o', InputOption::VALUE_NONE, sprintf( - $this->translate( - 'Optimize database when possible (should execute with %s command)' + $this->translateContext( + 'Optimize database when possible (should execute with %s command)', + 'console' ), sprintf( '--%s', @@ -157,10 +166,11 @@ protected function configure(): void ]) ->setHelp( sprintf( - $this->translate(<<<'EOT' -The %s help you to validate database. -This command show information about installed database & configuration services. -EOT), + $this->translateContext( + "The %s help you to validate database.\n" + . "This command show information about installed database & configuration services.", + 'console' + ), '%command.name%' ) ); @@ -234,8 +244,9 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out if (!$container?->has(Connection::class)) { $this->writeDanger( $output, - $this->translate( - 'Can not get database object from container' + $this->translateContext( + 'Can not get database object from container', + 'console' ) ); return Command::FAILURE; @@ -244,8 +255,9 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out if (!$database instanceof Connection) { $this->writeDanger( $output, - $this->translate( - 'Database connection is not valid object from container' + $this->translateContext( + 'Database connection is not valid object from container', + 'console' ) ); return Command::FAILURE; @@ -349,7 +361,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output->writeln( sprintf( '%s', - $this->translate('No schema can be created') + $this->translateContext('No schema can be created', 'console') ) ); return Command::SUCCESS; @@ -381,7 +393,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output->writeln( sprintf( '%s', - $this->translate('No change into database schema') + $this->translateContext('No change into database schema', 'console') ) ); return Command::SUCCESS; @@ -411,7 +423,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $this->writeIndent( $output, sprintf( - $this->translate('Table "%s" does not exist!'), + $this->translateContext('Table "%s" does not exist!', 'console'), sprintf( '%s', $tableName @@ -423,8 +435,9 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $this->write( $output, sprintf( - $this->translate( - 'Table "%s" does not exist!' + $this->translateContext( + 'Table "%s" does not exist!', + 'console' ), sprintf( '%s', @@ -447,8 +460,9 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $this->writeIndent( $output, sprintf( - $this->translate( - 'Table "%s" %s' + $this->translateContext( + 'Table "%s" %s', + 'console' ), sprintf( '%s', @@ -458,12 +472,12 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out '%s%s%s', sprintf( '%s', - $this->translate('no difference') + $this->translateContext('no difference', 'console') ), $isNeedOptimize ? sprintf( ' [%s]', - $this->translate('NEED TO OPTIMIZE') + $this->translateContext('NEED TO OPTIMIZE', 'console') ) : '', ($currentTable->getComment() ? sprintf(' (%s)', $currentTable->getComment()) @@ -480,7 +494,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $message = sprintf( '%s%s', sprintf( - $this->translate('Table "%s" need to be change'), + $this->translateContext('Table "%s" need to be change', 'console'), sprintf( '%s', $tableName, @@ -488,7 +502,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out ), $isNeedOptimize ? sprintf( ' [%s]', - $this->translate('NEED TO OPTIMIZE') + $this->translateContext('NEED TO OPTIMIZE', 'console') ) : '', ); if (!$isExecute) { @@ -517,11 +531,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), - $this->translate('type'), + $this->translateContext('type', 'console'), sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $typeRegistry->lookupName($oldColumn->getType()) @@ -539,11 +553,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), - $this->translate('default value'), + $this->translateContext('default value', 'console'), sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $oldColumn->getDefault() ?? '' @@ -561,11 +575,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), 'fixed', sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $oldColumn->getFixed() ? 'YES' : 'NO' @@ -583,11 +597,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), 'auto increment', sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $oldColumn->getAutoincrement() ? 'YES' : 'NO' @@ -605,11 +619,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), 'length', sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $oldColumn->getLength() ?? '' @@ -627,11 +641,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), 'precision', sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $oldColumn->getPrecision() ?? '' @@ -649,18 +663,18 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), 'not null', sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', - !$oldColumn->getNotnull() ? 'YES' : 'NOT' + !$oldColumn->getNotnull() ? 'YES' : 'NO' ), sprintf( '%s', - !$newColumn->getNotnull() ? 'YES' : 'NOT' + !$newColumn->getNotnull() ? 'YES' : 'NO' ) ) ) @@ -671,11 +685,14 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), - $this->translate('scale'), + $this->translateContext('scale', 'console'), sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext( + 'change from: [%s] to [%s]', + 'console' + ), sprintf( '%s', $oldColumn->getScale() ??'' @@ -693,11 +710,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), 'unsigned', sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $oldColumn->getUnsigned() ? 'YES' : 'NO' @@ -715,11 +732,11 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s %s %s', - $this->translate('Column'), + $this->translateContext('Column', 'console'), $newColumn->getName(), - $this->translate('comment'), + $this->translateContext('comment', 'console'), sprintf( - $this->translate('change from: [%s] to [%s]'), + $this->translateContext('change from: [%s] to [%s]', 'console'), sprintf( '%s', $oldColumn->getComment() ?? '' @@ -740,7 +757,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s [%s]', - $this->translate('Added Column'), + $this->translateContext('Added Column', 'console'), $column->getName() ) ); @@ -751,7 +768,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s [%s]', - $this->translate('Removed Column'), + $this->translateContext('Removed Column', 'console'), $column->getName() ) ); @@ -762,9 +779,9 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s', - $this->translate('Renamed Column'), + $this->translateContext('Renamed Column', 'console'), sprintf( - $this->translate('from [%s] to [%s]'), + $this->translateContext('from [%s] to [%s]', 'console'), sprintf( '%s', $columnName @@ -787,24 +804,30 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s', - $this->translate('Modify index'), + $this->translateContext('Modify Index', 'console'), sprintf( - 'from [%s](%s) to [%s](%s)', + $this->translateContext('from %s to %s', 'console'), sprintf( - '%s', - $indexName - ), - sprintf( - '%s', - implode(', ', $oldIndex->getColumns()) - ), - sprintf( - '%s', - $index->getName() + '[%s](%s)', + sprintf( + '%s', + $indexName + ), + sprintf( + '%s', + implode(', ', $oldIndex->getColumns()) + ) ), sprintf( - '%s', - implode(', ', $index->getColumns()) + '[%s](%s)', + sprintf( + '%s', + $index->getName() + ), + sprintf( + '%s', + implode(', ', $index->getColumns()) + ) ) ) ) @@ -816,7 +839,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s [%s] %s', - $this->translate('Added Index'), + $this->translateContext('Added Index', 'console'), $index->getName(), sprintf( 'with columns [%s]', @@ -834,7 +857,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s [%s] %s', - $this->translate('Removed Index'), + $this->translateContext('Removed Index', 'console'), $index->getName(), sprintf( 'contain columns [%s]', @@ -854,7 +877,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output, sprintf( '- %s %s', - $this->translate('Renamed index'), + $this->translateContext('Renamed Index', 'console'), sprintf( 'from [%s] to [%s]', sprintf('%s', $indexName), @@ -875,7 +898,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out '- %s [%s](%s)' . ' -> (%s)' . ' [%s](%s) -> (%s)%s', - $this->translate('Modify ForeignKey'), + $this->translateContext('Modify ForeignKey', 'console'), $foreignName, sprintf( '%s(%s)', @@ -921,7 +944,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out sprintf( '- %s [%s](%s) ' . '-> (%s)', - $this->translate('Added ForeignKey'), + $this->translateContext('Added ForeignKey', 'console'), $foreignKey->getName(), sprintf( '%s(%s)', @@ -943,7 +966,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out sprintf( '- %s [%s](%s) ' . '-> (%s)', - $this->translate('Removed ForeignKey'), + $this->translateContext('Removed ForeignKey', 'console'), $foreignKey->getName(), sprintf( '%s(%s)', @@ -979,7 +1002,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out sprintf( '%s%s', sprintf( - $this->translate('Table "%s" for %s & does not exist in schema'), + $this->translateContext( + 'Table "%s" for %s & does not exist in schema', + 'console' + ), sprintf( '%s', $table->getName(), @@ -1009,7 +1035,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out sprintf( '%s%s', sprintf( - $this->translate('Table "%s" for %s & does not exist in schema'), + $this->translateContext( + 'Table "%s" for %s & does not exist in schema', + 'console' + ), sprintf( '%s', $table->getName(), @@ -1040,7 +1069,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out sprintf( '%s%s', sprintf( - $this->translate('Table "%s" for %s & does not exist in schema'), + $this->translateContext( + 'Table "%s" for %s & does not exist in schema', + 'console' + ), sprintf( '%s', $table->getName(), @@ -1066,7 +1098,7 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out sprintf( '%s%s', sprintf( - $this->translate('Table "%s" for %s'), + $this->translateContext('Table "%s" for %s', 'console'), sprintf( '%s', $table->getName(), @@ -1112,7 +1144,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output->writeln( sprintf( '%s', - $this->translate('Contains changed database schema, you can execute command :') + $this->translateContext( + 'Contains changed database schema, you can execute command :', + 'console' + ) ) ); $output->writeln(''); @@ -1134,7 +1169,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output->writeln( sprintf( '%s', - $this->translate('Contains database table that can be optimized, you can execute command :') + $this->translateContext( + 'Contains database table that can be optimized, you can execute command :', + 'console' + ) ) ); $output->writeln(''); @@ -1159,7 +1197,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $output->writeln( sprintf( '%s', - $this->translate('There are no tables that can be optimized') + $this->translateContext( + 'There are no tables that can be optimized', + 'console' + ) ) ); return Command::SUCCESS; @@ -1171,7 +1212,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $className = preg_replace('~Platform$~', '', $className); $output->writeln( sprintf( - $this->translate('%s does not yet support optimization'), + $this->translateContext( + '%s does not yet support optimization', + 'console' + ), sprintf( '%s', $className @@ -1189,7 +1233,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out $optimizeArray[$tableName] = $table->getName(); $output->writeln( sprintf( - $this->translate('Table "%s" can be freed up to : (%s)'), + $this->translateContext( + 'Table "%s" can be freed up to : (%s)', + 'console' + ), sprintf( '%s', $table->getName(), @@ -1204,7 +1251,10 @@ public function databaseSchemaDetect(InputInterface $input, OutputInterface $out /** @noinspection DuplicatedCode */ $answer = $interactive ? $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext( + 'Are you sure to continue (Yes/No)?', + 'console' + ), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -1216,7 +1266,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -1226,7 +1279,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return Command::SUCCESS; @@ -1235,7 +1288,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('PLEASE DO NOT CANCEL OPERATION!') + $this->translateContext('PLEASE DO NOT CANCEL OPERATION!', 'console') ) ); $output->writeln(''); @@ -1243,7 +1296,7 @@ function ($e) { $output->write( sprintf( '%s "%s"', - $this->translate('Optimizing table'), + $this->translateContext('Optimizing table', 'console'), $tableName ) ); @@ -1272,7 +1325,7 @@ function ($e) { $output->writeln( sprintf( ' [%s] %s', - $this->translate('FAIL'), + $this->translateContext('FAIL', 'console'), $e->getMessage() ) ); @@ -1282,7 +1335,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('ALL DONE!') + $this->translateContext('ALL DONE!', 'console') ) ); return Command::SUCCESS; @@ -1304,7 +1357,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('No change into database schema') + $this->translateContext('No change into database schema', 'console') ) ); return Command::SUCCESS; @@ -1315,7 +1368,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('No change into database schema') + $this->translateContext('No change into database schema', 'console') ) ); return Command::SUCCESS; @@ -1325,7 +1378,7 @@ function ($e) { $output->writeLn( sprintf( '%s', - $this->translate('Executed Command:') + $this->translateContext('Executed Command:', 'console') ) ); $output->writeln(''); @@ -1340,7 +1393,10 @@ function ($e) { /** @noinspection DuplicatedCode */ $answer = $interactive ? $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext( + 'Are you sure to continue (Yes/No)?', + 'console' + ), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -1352,7 +1408,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -1363,7 +1422,10 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext( + 'Operation cancelled!', + 'console' + ) ) ); return Command::SUCCESS; @@ -1373,7 +1435,10 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('PLEASE DO NOT CANCEL OPERATION!') + $this->translateContext( + 'PLEASE DO NOT CANCEL OPERATION!', + 'console' + ) ) ); $output->writeln(''); @@ -1397,7 +1462,7 @@ function ($e) { $output->writeln( sprintf( '%s %s', - $this->translate('Executing:'), + $this->translateContext('Executing:', 'console'), $sql ), OutputInterface::VERBOSITY_VERY_VERBOSE @@ -1415,7 +1480,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Failed to execute command') + $this->translateContext('Failed to execute command', 'console') ) ); $output->writeln( @@ -1444,7 +1509,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Failed to execute command') + $this->translateContext('Failed to execute command', 'console') ) ); $output->writeln( @@ -1459,7 +1524,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('ALL DONE!') + $this->translateContext('ALL DONE!', 'console') ) ); return Command::SUCCESS; @@ -1476,8 +1541,9 @@ private function doDatabaseCheck( if (!$container?->has(Connection::class)) { $this->writeDanger( $output, - $this->translate( - 'Can not get database object from container' + $this->translateContext( + 'Can not get database object from container', + 'console' ) ); return; @@ -1487,8 +1553,9 @@ private function doDatabaseCheck( if (!$database instanceof Connection) { $this->writeDanger( $output, - $this->translate( - 'Database connection is not valid object from container' + $this->translateContext( + 'Database connection is not valid object from container', + 'console' ), ); return; @@ -1512,13 +1579,13 @@ private function doDatabaseCheck( if ($error) { $this->writeDanger( $output, - $this->translate('Database connection error.') + $this->translateContext('Database connection error.', 'console') ); $this->writeIndent( $output, sprintf( '%s [%s] %s', - $this->translate('Error:'), + $this->translateContext('Error:', 'console'), $error::class, $error->getMessage() ), @@ -1530,7 +1597,7 @@ private function doDatabaseCheck( $output, sprintf( '%s [%s]', - $this->translate('Database connection succeed'), + $this->translateContext('Database connection succeed', 'console'), $database::class ), self::MODE_SUCCESS @@ -1568,7 +1635,7 @@ private function doDatabaseCheck( $output, sprintf( '%s [%s]', - $this->translate('Database name'), + $this->translateContext('Database name', 'console'), $dbName ?? '' ), $error ? self::MODE_DANGER : self::MODE_SUCCESS @@ -1585,7 +1652,7 @@ private function doDatabaseCheck( $output, sprintf( '%s [%s]', - $this->translate('Database host'), + $this->translateContext('Database host', 'console'), $dbHost ?? '' ), $errorX ? self::MODE_DANGER : self::MODE_SUCCESS @@ -1594,7 +1661,7 @@ private function doDatabaseCheck( $output, sprintf( '%s [%s]', - $this->translate('Database user'), + $this->translateContext('Database user', 'console'), $dbUser ?? '' ), $error ? self::MODE_DANGER : self::MODE_SUCCESS @@ -1603,7 +1670,7 @@ private function doDatabaseCheck( $output, sprintf( '%s [%s]', - $this->translate('Database password'), + $this->translateContext('Database password', 'console'), $dbPass ? '' : '' ), $error ? self::MODE_DANGER : ( @@ -1625,7 +1692,7 @@ private function doDatabaseCheck( sprintf( // no translate for driver 'Driver [%s]', - $this->translate('Unknown'), + $this->translateContext('Unknown', 'console'), ) ); } @@ -1634,7 +1701,7 @@ private function doDatabaseCheck( $output, sprintf( '%s', - $this->translate('Connection Object Info') + $this->translateContext('Connection Object Info', 'console') ), $error ? self::MODE_WARNING : self::MODE_SUCCESS ); @@ -1642,7 +1709,7 @@ private function doDatabaseCheck( $output, sprintf( '- %s [%s]', - $this->translate('Connection'), + $this->translateContext('Connection', 'console'), $database::class ) ); @@ -1696,21 +1763,21 @@ private function doDatabaseCheck( $output, sprintf( '%s', - $this->translate('ORM Configuration') + $this->translateContext('ORM Configuration', 'console') ), $error ? self::MODE_DANGER : self::SUCCESS ); if ($ormConfig) { $lists = [ - 'Query Cache' => $ormConfig->getQueryCache(), - 'Result Cache' => $ormConfig->getResultCache(), - 'Proxy Namespace' => $ormConfig->getProxyNamespace(), - 'Proxy Directory' => $ormConfig->getProxyDir(), - 'Metadata Driver' => $ormConfig->getMetadataDriverImpl(), - 'Repository Factory' => $ormConfig->getRepositoryFactory(), - 'Quote Strategy' => $ormConfig->getQuoteStrategy(), - 'Naming Factory' => $ormConfig->getNamingStrategy(), - 'Schema Manager Factory' => $ormConfig->getSchemaManagerFactory(), + $this->translateContext('Query Cache', 'console') => $ormConfig->getQueryCache(), + $this->translateContext('Result Cache', 'console') => $ormConfig->getResultCache(), + $this->translateContext('Proxy Namespace', 'console') => $ormConfig->getProxyNamespace(), + $this->translateContext('Proxy Directory', 'console') => $ormConfig->getProxyDir(), + $this->translateContext('Metadata Driver', 'console') => $ormConfig->getMetadataDriverImpl(), + $this->translateContext('Repository Factory', 'console') => $ormConfig->getRepositoryFactory(), + $this->translateContext('Quote Strategy', 'console') => $ormConfig->getQuoteStrategy(), + $this->translateContext('Naming Factory', 'console') => $ormConfig->getNamingStrategy(), + $this->translateContext('Schema Manager Factory', 'console') => $ormConfig->getSchemaManagerFactory(), ]; foreach ($lists as $key => $obj) { $this->writeIndent( @@ -1718,7 +1785,9 @@ private function doDatabaseCheck( sprintf( '- %s [%s]', $key, - is_object($obj) ? $obj::class : ( is_string($obj) ? $obj : $this->translate('Not Set')) + is_object($obj) ? $obj::class : ( + is_string($obj) ? $obj : $this->translateContext('Not Set', 'console') + ) ) ); } @@ -1727,7 +1796,7 @@ private function doDatabaseCheck( $output, sprintf( '%s (%d)', - $this->translate('Registered Schema / Entities'), + $this->translateContext('Registered Schema / Entities', 'console'), count($allMetadata) ), $error ? self::MODE_DANGER : self::MODE_SUCCESS @@ -1846,7 +1915,7 @@ protected function doCheckData( $isNeedOptimize ? sprintf( ' [%s]', - $this->translate('NEED TO OPTIMIZE') + $this->translateContext('NEED TO OPTIMIZE', 'console') ) : ( !$existTable ? ' [NOT EXISTS]' : '' ), @@ -1860,7 +1929,7 @@ protected function doCheckData( sprintf( '%s%s : %s', $this->getSpacing(), - $this->translate('Changing'), + $this->translateContext('Changing', 'console'), implode(', ', $changed) ), OutputInterface::VERBOSITY_DEBUG @@ -1873,7 +1942,10 @@ protected function doCheckData( $output, sprintf( '%s', - $this->translate('Contains changed database schema, you can check with command :') + $this->translateContext( + 'Contains changed database schema, you can check with command :', + 'console' + ) ) ); $output->writeln(''); @@ -1895,7 +1967,10 @@ protected function doCheckData( $output, sprintf( '%s', - $this->translate('Contains database table that can be optimized, you can execute command :') + $this->translateContext( + 'Contains database table that can be optimized, you can execute command :', + 'console' + ) ) ); $output->writeln(''); diff --git a/src/Console/Command/DatabaseEventGenerator.php b/src/Console/Command/DatabaseEventGenerator.php index 385919f..04ae2c7 100644 --- a/src/Console/Command/DatabaseEventGenerator.php +++ b/src/Console/Command/DatabaseEventGenerator.php @@ -80,23 +80,22 @@ protected function configure() : void //'app:generate:db-event' ]) ->setDescription( - $this->translate('Generate database event class.') + $this->translateContext('Generate database event class.', 'console') )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_NONE, - $this->translate('Print generated class file only') + $this->translateContext('Print generated class file only', 'console') ) ])->setHelp( sprintf( - $this->translate(<<translateContext( + "The %s help you to create %s object.\n\n" + . "Database Event will use prefix namespace with %s\n" + . "Database Event only support single class name.", + 'console' + ), '%command.name%', 'databaseEvent', sprintf( @@ -176,13 +175,13 @@ protected function askClassName(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); return $io->ask( - $this->translate('Please enter database event class name'), + $this->translateContext('Please enter database event class name', 'console'), null, function ($name) { $definitions = $this->filterNames($name); if ($definitions === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid database event class name!') + $this->translateContext('Please enter valid database event class name!', 'console') ); } $databaseEventName = $definitions['identity']; @@ -190,8 +189,9 @@ function ($name) { if (!Consolidation::allowedClassName($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Event [%s] is invalid! class name contain reserved keyword!' + $this->translateContext( + 'Event [%s] is invalid! class name contain reserved keyword!', + 'console' ), $className ) @@ -200,8 +200,9 @@ function ($name) { if (count(explode('\\', $className)) > 1) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Event [%s] is invalid! Database event only contain single class name, not namespaced!' + $this->translateContext( + 'Event [%s] is invalid! Database event only contain single class name, not namespaced!', + 'console' ), $className ) @@ -210,8 +211,9 @@ function ($name) { if (strlen($databaseEventName) > 128) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Database event [%s] is too long! Must be less or equal 128 characters' + $this->translateContext( + 'Database event [%s] is too long! Must be less or equal 128 characters', + 'console' ), $databaseEventName ) @@ -220,7 +222,7 @@ function ($name) { if ($this->isFileExists($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate('Database event [%s] exist'), + $this->translateContext('Database event [%s] exist', 'console'), $this->databaseEventNamespace . $className ) ); @@ -249,8 +251,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->databaseEventDir) { $output->writeln( sprintf( - $this->translate( - '%s Could not detect database event directory' + $this->translateContext( + '%s Could not detect database event directory', + 'console' ), '[X]' ) @@ -262,8 +265,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$named && !$input->isInteractive()) { $output->writeln( sprintf( - $this->translate( - '%s generator only support in interactive mode' + $this->translateContext( + '%s generator only support in interactive mode', + 'console' ), '[X]' ) @@ -284,8 +288,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln( sprintf( - $this->translate( - 'Database Event Name : %s' + $this->translateContext( + 'Database Event Name : %s', + 'console' ), sprintf( '%s', @@ -296,8 +301,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $className = $this->databaseEventNamespace . $named['className']; $output->writeln( sprintf( - $this->translate( - 'DatabaseEvent Class : %s' + $this->translateContext( + 'DatabaseEvent Class : %s', + 'console' ), sprintf( '%s', @@ -307,8 +313,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'DatabaseEvent File : %s' + $this->translateContext( + 'DatabaseEvent File : %s', + 'console' ), sprintf( '%s', @@ -319,7 +326,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @noinspection DuplicatedCode */ $io = new SymfonyStyle($input, $output); $answer = !$input->isInteractive() || $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext('Are you sure to continue (Yes/No)?', 'console'), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -331,7 +338,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -350,8 +360,9 @@ function ($e) { if (!$status) { $output->writeln( sprintf( - $this->translate( - '%s Could not save databaseEvent!' + $this->translateContext( + '%s Could not save databaseEvent!', + 'console' ), '[X]' ) @@ -360,8 +371,9 @@ function ($e) { } $output->writeln( sprintf( - $this->translate( - '%s DatabaseEvent successfully created!' + $this->translateContext( + '%s DatabaseEvent successfully created!', + 'console' ), '[√]' ) @@ -371,7 +383,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; diff --git a/src/Console/Command/EntityGenerator.php b/src/Console/Command/EntityGenerator.php index a2b695b..bf0fcc1 100644 --- a/src/Console/Command/EntityGenerator.php +++ b/src/Console/Command/EntityGenerator.php @@ -76,22 +76,21 @@ protected function configure() : void ->setName('app:generate:entity') ->setAliases(['generate-entity']) ->setDescription( - $this->translate('Generate entity class.') + $this->translateContext('Generate entity class.', 'console') )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_NONE, - $this->translate('Print generated class file only') + $this->translateContext('Print generated class file only', 'console') ) ])->setHelp( sprintf( - $this->translate(<<translateContext( + "The %s help you to create %s object.\n\n" + . "Entity will use prefix namespace with %s\n", + 'console' + ), '%command.name%', 'entity', sprintf( @@ -171,13 +170,13 @@ protected function askClassName(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); return $io->ask( - $this->translate('Please enter entity name'), + $this->translateContext('Please enter entity name', 'console'), null, function ($name) { $definitions = $this->filterNames($name); if ($definitions === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid entity name!') + $this->translateContext('Please enter valid entity name!', 'console') ); } $tableName = $definitions['tableName']; @@ -185,8 +184,9 @@ function ($name) { if (!Consolidation::allowedClassName($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Entity [%s] is invalid! class name contain reserved keyword!' + $this->translateContext( + 'Entity [%s] is invalid! class name contain reserved keyword!', + 'console' ), $className ) @@ -195,8 +195,9 @@ function ($name) { if (strlen($tableName) > 64) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Table name [%s] is too long! Must be less or equal 64 characters' + $this->translateContext( + 'Table name [%s] is too long! Must be less or equal 64 characters', + 'console' ), $tableName ) @@ -205,7 +206,7 @@ function ($name) { if ($this->isFileExists($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate('Entity [%s] exist'), + $this->translateContext('Entity [%s] exist', 'console'), $this->entityNamespace . $className ) ); @@ -234,8 +235,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->entityDir) { $output->writeln( sprintf( - $this->translate( - '%s Could not detect entity directory' + $this->translateContext( + '%s Could not detect entity directory', + 'console' ), '[X]' ) @@ -247,8 +249,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$named && !$input->isInteractive()) { $output->writeln( sprintf( - $this->translate( - '%s generator only support in interactive mode' + $this->translateContext( + '%s generator only support in interactive mode', + 'console' ), '[X]' ) @@ -269,8 +272,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln( sprintf( - $this->translate( - 'Entity Name : %s' + $this->translateContext( + 'Entity Name : %s', + 'console' ), sprintf( '%s', @@ -280,8 +284,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Table Name : %s' + $this->translateContext( + 'Table Name : %s', + 'console' ), sprintf( '%s', @@ -292,8 +297,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $className = $this->entityNamespace . $named['className']; $output->writeln( sprintf( - $this->translate( - 'Entity Class : %s' + $this->translateContext( + 'Entity Class : %s', + 'console' ), sprintf( '%s', @@ -303,8 +309,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Entity File : %s' + $this->translateContext( + 'Entity File : %s', + 'console' ), sprintf( '%s', @@ -315,7 +322,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @noinspection DuplicatedCode */ $io = new SymfonyStyle($input, $output); $answer = !$input->isInteractive() || $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext('Are you sure to continue (Yes/No)?', 'console'), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -327,7 +334,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -347,8 +357,9 @@ function ($e) { if (!$status) { $output->writeln( sprintf( - $this->translate( - '%s Could not save entity!' + $this->translateContext( + '%s Could not save entity!', + 'console' ), '[X]' ) @@ -357,8 +368,9 @@ function ($e) { } $output->writeln( sprintf( - $this->translate( - '%s Entity successfully created!' + $this->translateContext( + '%s Entity successfully created!', + 'console' ), '[√]' ) @@ -368,7 +380,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; diff --git a/src/Console/Command/MiddlewareGenerator.php b/src/Console/Command/MiddlewareGenerator.php index 1fbff88..fa6fa70 100644 --- a/src/Console/Command/MiddlewareGenerator.php +++ b/src/Console/Command/MiddlewareGenerator.php @@ -76,22 +76,21 @@ protected function configure() : void ->setName('app:generate:middleware') ->setAliases(['generate-middleware']) ->setDescription( - $this->translate('Generate middleware class.') + $this->translateContext('Generate middleware class.', 'console') )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_NONE, - $this->translate('Print generated class file only') + $this->translateContext('Print generated class file only', 'console') ) ])->setHelp( sprintf( - $this->translate(<<translateContext( + "The %s help you to create %s object.\n\n" + . "Middleware will use prefix namespace with %s\n", + 'console' + ), '%command.name%', 'middleware', sprintf( @@ -171,21 +170,28 @@ protected function askClassName(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); return $io->ask( - $this->translate('Please enter middleware class name'), + $this->translateContext( + 'Please enter middleware class name', + 'console' + ), null, function ($name) { $definitions = $this->filterNames($name); if ($definitions === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid middleware class name!') + $this->translateContext( + 'Please enter valid middleware class name!', + 'console' + ) ); } $className = $definitions['className']; if (!Consolidation::allowedClassName($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Middleware [%s] is invalid! class name contain reserved keyword!' + $this->translateContext( + 'Middleware [%s] is invalid! class name contain reserved keyword!', + 'console' ), $className ) @@ -194,7 +200,10 @@ function ($name) { if ($this->isFileExists($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate('Middleware [%s] exist'), + $this->translateContext( + 'Middleware [%s] exist', + 'console' + ), $this->middlewareNamespace . $className ) ); @@ -223,8 +232,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->middlewareDir) { $output->writeln( sprintf( - $this->translate( - '%s Could not detect middleware directory' + $this->translateContext( + '%s Could not detect middleware directory', + 'console' ), '[X]' ) @@ -236,8 +246,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$named && !$input->isInteractive()) { $output->writeln( sprintf( - $this->translate( - '%s generator only support in interactive mode' + $this->translateContext( + '%s generator only support in interactive mode', + 'console' ), '[X]' ) @@ -257,8 +268,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln( sprintf( - $this->translate( - 'Middleware Name : %s' + $this->translateContext( + 'Middleware Name : %s', + 'console' ), sprintf( '%s', @@ -270,8 +282,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $className = $this->middlewareNamespace . $named['className']; $output->writeln( sprintf( - $this->translate( - 'Middleware Class : %s' + $this->translateContext( + 'Middleware Class : %s', + 'console' ), sprintf( '%s', @@ -281,8 +294,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Middleware File : %s' + $this->translateContext( + 'Middleware File : %s', + 'console' ), sprintf( '%s', @@ -293,7 +307,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @noinspection DuplicatedCode */ $io = new SymfonyStyle($input, $output); $answer = !$input->isInteractive() || $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext( + 'Are you sure to continue (Yes/No)?', + 'console' + ), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -305,7 +322,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -324,8 +344,9 @@ function ($e) { if (!$status) { $output->writeln( sprintf( - $this->translate( - '%s Could not save middleware!' + $this->translateContext( + '%s Could not save middleware!', + 'console' ), '[X]' ) @@ -334,8 +355,9 @@ function ($e) { } $output->writeln( sprintf( - $this->translate( - '%s Middleware successfully created!' + $this->translateContext( + '%s Middleware successfully created!', + 'console' ), '[√]' ) @@ -345,7 +367,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; diff --git a/src/Console/Command/ModuleGenerator.php b/src/Console/Command/ModuleGenerator.php index c99b836..d0c2794 100644 --- a/src/Console/Command/ModuleGenerator.php +++ b/src/Console/Command/ModuleGenerator.php @@ -76,23 +76,22 @@ protected function configure() : void ->setName('app:generate:module') ->setAliases(['generate-module']) ->setDescription( - $this->translate('Generate module class.') + $this->translateContext('Generate module class.', 'console') )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_NONE, - $this->translate('Print generated class file only') + $this->translateContext('Print generated class file only', 'console') ) ])->setHelp( sprintf( - $this->translate(<<translateContext( + "The %s help you to create %s object.\n\n" + . "Module will use prefix namespace with %s\n" + . "Module only support single class name.\n", + 'console' + ), '%command.name%', 'module', sprintf( @@ -172,13 +171,16 @@ protected function askClassName(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); return $io->ask( - $this->translate('Please enter module class name'), + $this->translateContext('Please enter module class name', 'console'), null, function ($name) { $definitions = $this->filterNames($name); if ($definitions === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid module class name!') + $this->translateContext( + 'Please enter valid module class name!', + 'console' + ) ); } $moduleName = $definitions['identity']; @@ -186,8 +188,9 @@ function ($name) { if (!Consolidation::allowedClassName($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Module [%s] is invalid! class name contain reserved keyword!' + $this->translateContext( + 'Module [%s] is invalid! class name contain reserved keyword!', + 'console' ), $className ) @@ -196,8 +199,9 @@ function ($name) { if (count(explode('\\', $className)) > 1) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Module [%s] is invalid! Module only contain single class name, not namespaced!' + $this->translateContext( + 'Module [%s] is invalid! Module only contain single class name, not namespaced!', + 'console' ), $className ) @@ -206,8 +210,9 @@ function ($name) { if (strlen($moduleName) > 128) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Module [%s] is too long! Must be less or equal 128 characters' + $this->translateContext( + 'Module [%s] is too long! Must be less or equal 128 characters', + 'console' ), $moduleName ) @@ -216,7 +221,7 @@ function ($name) { if ($this->isFileExists($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate('Module [%s] exist'), + $this->translateContext('Module [%s] exist', 'console'), $this->moduleNamespace . $className ) ); @@ -245,8 +250,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->moduleDir) { $output->writeln( sprintf( - $this->translate( - '%s Could not detect module directory' + $this->translateContext( + '%s Could not detect module directory', + 'console' ), '[X]' ) @@ -258,8 +264,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$named && !$input->isInteractive()) { $output->writeln( sprintf( - $this->translate( - '%s generator only support in interactive mode' + $this->translateContext( + '%s generator only support in interactive mode', + 'console' ), '[X]' ) @@ -282,8 +289,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln( sprintf( - $this->translate( - 'Module Name : %s' + $this->translateContext( + 'Module Name : %s', + 'console' ), sprintf( '%s', @@ -295,8 +303,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $className = $namespace . '\\' . $named['className']; $output->writeln( sprintf( - $this->translate( - 'Module Class : %s' + $this->translateContext( + 'Module Class : %s', + 'console' ), sprintf( '%s', @@ -306,8 +315,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Module Namespace : %s' + $this->translateContext( + 'Module Namespace : %s', + 'console' ), sprintf( '%s', @@ -317,8 +327,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Module File : %s' + $this->translateContext( + 'Module File : %s', + 'console' ), sprintf( '%s', @@ -329,7 +340,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @noinspection DuplicatedCode */ $io = new SymfonyStyle($input, $output); $answer = !$input->isInteractive() || $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext( + 'Are you sure to continue (Yes/No)?', + 'console' + ), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -341,7 +355,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -360,8 +377,9 @@ function ($e) { if (!$status) { $output->writeln( sprintf( - $this->translate( - '%s Could not save module!' + $this->translateContext( + '%s Could not save module!', + 'console' ), '[X]' ) @@ -370,8 +388,9 @@ function ($e) { } $output->writeln( sprintf( - $this->translate( - '%s Module successfully created!' + $this->translateContext( + '%s Module successfully created!', + 'console' ), '[√]' ) @@ -381,7 +400,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; @@ -418,7 +437,7 @@ class $baseClassName extends AbstractModule /** * @method doInit() called when kernel loaded init - * @see BaseKernel::init() + * @see BaseKernel::init() * @return void */ protected function doInit(): void diff --git a/src/Console/Command/SchedulerAction.php b/src/Console/Command/SchedulerAction.php index aa981ea..24bf233 100644 --- a/src/Console/Command/SchedulerAction.php +++ b/src/Console/Command/SchedulerAction.php @@ -35,21 +35,22 @@ protected function configure(): void ->setName('app:scheduler') ->setAliases(['run-scheduler']) ->setDescription( - $this->translate('List or run scheduler.') + $this->translateContext('List or run scheduler.', 'console') ) ->setDefinition([ new InputOption( 'run', 'x', InputOption::VALUE_NONE, - $this->translate('Run the pending schedulers') + $this->translateContext('Run the pending schedulers', 'console') ) ]) ->setHelp( sprintf( - $this->translate(<<<'EOT' -The %s help you to list & run scheduler -EOT), + $this->translateContext( + 'The %s help you to list & run scheduler', + 'console' + ), '%command.name%' ) ); @@ -73,7 +74,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); if (!$scheduler instanceof Scheduler) { throw new RuntimeException( - 'Object scheduler is not valid' + $this->translateContext( + 'Object scheduler is not valid', + 'console' + ) ); } @@ -95,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln( sprintf( '%s', - $this->translate('No task in queue') + $this->translateContext('No task in queue', 'console') ) ); return self::SUCCESS; @@ -104,10 +108,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int sprintf( '%s', sprintf( - $this->translatePlural( + $this->translatePluralContext( 'Executing %s task', 'Executing %s tasks', - $countQueue + $countQueue, + 'console' ), $countQueue ) @@ -122,10 +127,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int sprintf( '%s %s', $countQueue, - $this->translatePlural( + $this->translatePluralContext( 'scheduler in queue to run', 'schedulers in queue to run', - $countQueue + $countQueue, + 'console' ) ), $countQueue === 0 ? self::MODE_SUCCESS : self::MODE_WARNING @@ -135,7 +141,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $interval = $task->getInterval(); if (is_int($interval)) { $every = sprintf( - $this->translate('run every %s seconds'), + $this->translateContext('run every %s seconds', 'console'), sprintf( '%s', max($interval, Task::MINIMUM_INTERVAL_TIME) @@ -143,7 +149,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); } else { $every = sprintf( - $this->translate('next executed time %s'), + $this->translateContext('next executed time %s', 'console'), sprintf( '[%s]', $interval->getNextRunDate()->format('Y-m-d H:i:s e') @@ -167,10 +173,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int sprintf( '%s %s', $countSkipped, - $this->translatePlural( + $this->translatePluralContext( 'scheduler skipped', 'schedulers skipped', - $countSkipped + $countSkipped, + 'console' ) ), self::MODE_SUCCESS @@ -180,7 +187,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $interval = $task->getInterval(); if (is_int($interval)) { $every = sprintf( - $this->translate('run every %s seconds'), + $this->translateContext('run every %s seconds', 'console'), sprintf( '%s', max($interval, Task::MINIMUM_INTERVAL_TIME) @@ -188,7 +195,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); } else { $every = sprintf( - $this->translate('next executed time %s'), + $this->translateContext('next executed time %s', 'console'), sprintf( '[%s]', $interval->getNextRunDate()->format('Y-m-d H:i:s e') diff --git a/src/Console/Command/SchedulerGenerator.php b/src/Console/Command/SchedulerGenerator.php index 51edde0..85e0073 100644 --- a/src/Console/Command/SchedulerGenerator.php +++ b/src/Console/Command/SchedulerGenerator.php @@ -76,23 +76,22 @@ protected function configure() : void ->setName('app:generate:scheduler') ->setAliases(['generate-scheduler']) ->setDescription( - $this->translate('Generate scheduler class.') + $this->translateContext('Generate scheduler class.', 'console') )->setDefinition([ new InputOption( 'print', 'p', InputOption::VALUE_NONE, - $this->translate('Print generated class file only') + $this->translateContext('Print generated class file only', 'console') ) ])->setHelp( sprintf( - $this->translate(<<translateContext( + "The %s help you to create %s object.\n\n" + . "Scheduler will use prefix namespace with %s\n" + . "Scheduler only support single class name.\n\n", + 'console' + ), '%command.name%', 'scheduler', sprintf( @@ -172,13 +171,16 @@ protected function askClassName(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); return $io->ask( - $this->translate('Please enter scheduler class name'), + $this->translateContext('Please enter scheduler class name', 'console'), null, function ($name) { $definitions = $this->filterNames($name); if ($definitions === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid scheduler class name!') + $this->translateContext( + 'Please enter valid scheduler class name!', + 'console' + ) ); } $schedulerName = $definitions['identity']; @@ -186,8 +188,9 @@ function ($name) { if (!Consolidation::allowedClassName($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Scheduler [%s] is invalid! class name contain reserved keyword!' + $this->translateContext( + 'Scheduler [%s] is invalid! class name contain reserved keyword!', + 'console' ), $className ) @@ -196,8 +199,9 @@ function ($name) { if (count(explode('\\', $className)) > 1) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Scheduler [%s] is invalid! Scheduler only contain single class name, not namespaced!' + $this->translateContext( + 'Scheduler [%s] is invalid! Scheduler only contain single class name, not namespaced!', + 'console' ), $className ) @@ -206,8 +210,9 @@ function ($name) { if (strlen($schedulerName) > 128) { throw new InteractiveArgumentException( sprintf( - $this->translate( - 'Scheduler [%s] is too long! Must be less or equal 128 characters' + $this->translateContext( + 'Scheduler [%s] is too long! Must be less or equal 128 characters', + 'console' ), $schedulerName ) @@ -216,7 +221,10 @@ function ($name) { if ($this->isFileExists($className)) { throw new InteractiveArgumentException( sprintf( - $this->translate('Scheduler [%s] exist'), + $this->translateContext( + 'Scheduler [%s] exist', + 'console' + ), $this->schedulerNamespace . $className ) ); @@ -246,8 +254,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$this->schedulerDir) { $output->writeln( sprintf( - $this->translate( - '%s Could not detect scheduler directory' + $this->translateContext( + '%s Could not detect scheduler directory', + 'console' ), '[X]' ) @@ -259,8 +268,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$named && !$input->isInteractive()) { $output->writeln( sprintf( - $this->translate( - '%s generator only support in interactive mode' + $this->translateContext( + '%s generator only support in interactive mode', + 'console' ), '[X]' ) @@ -286,8 +296,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln( sprintf( - $this->translate( - 'Scheduler Name : %s' + $this->translateContext( + 'Scheduler Name : %s', + 'console' ), sprintf( '%s', @@ -297,8 +308,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Scheduler Identity : %s' + $this->translateContext( + 'Scheduler Identity : %s', + 'console' ), sprintf( '%s', @@ -309,8 +321,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $className = $this->schedulerNamespace . $named['className']; $output->writeln( sprintf( - $this->translate( - 'Scheduler Class : %s' + $this->translateContext( + 'Scheduler Class : %s', + 'console' ), sprintf( '%s', @@ -320,8 +333,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int ); $output->writeln( sprintf( - $this->translate( - 'Scheduler File : %s' + $this->translateContext( + 'Scheduler File : %s', + 'console' ), sprintf( '%s', @@ -332,7 +346,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @noinspection DuplicatedCode */ $io = new SymfonyStyle($input, $output); $answer = !$input->isInteractive() || $io->ask( - $this->translate('Are you sure to continue (Yes/No)?'), + $this->translateContext('Are you sure to continue (Yes/No)?', 'console'), null, function ($e) { $e = !is_string($e) ? '' : $e; @@ -344,7 +358,10 @@ function ($e) { }; if ($ask === null) { throw new InteractiveArgumentException( - $this->translate('Please enter valid answer! (Yes / No)') + $this->translateContext( + 'Please enter valid answer! (Yes / No)', + 'console' + ) ); } return $ask; @@ -365,8 +382,9 @@ function ($e) { if (!$status) { $output->writeln( sprintf( - $this->translate( - '%s Could not save scheduler!' + $this->translateContext( + '%s Could not save scheduler!', + 'console' ), '[X]' ) @@ -375,8 +393,9 @@ function ($e) { } $output->writeln( sprintf( - $this->translate( - '%s Scheduler successfully created!' + $this->translateContext( + '%s Scheduler successfully created!', + 'console' ), '[√]' ) @@ -386,7 +405,7 @@ function ($e) { $output->writeln( sprintf( '%s', - $this->translate('Operation cancelled!') + $this->translateContext('Operation cancelled!', 'console') ) ); return self::SUCCESS; diff --git a/src/Console/Command/Traits/WriterHelperTrait.php b/src/Console/Command/Traits/WriterHelperTrait.php index e760354..31df75d 100644 --- a/src/Console/Command/Traits/WriterHelperTrait.php +++ b/src/Console/Command/Traits/WriterHelperTrait.php @@ -139,8 +139,9 @@ public function printUsage(OutputInterface $output): void $output->writeln(''); $output->writeln( sprintf( - $this->translate( - 'Time %s secs; Memory Usage: %s; Memory Peak Usage: %s' + $this->translateContext( + 'Time %s secs; Memory Usage: %s; Memory Peak Usage: %s', + 'console' ), round(microtime(true) - $this->getStartTime(), 3), Consolidation::sizeFormat( diff --git a/src/Event/Interfaces/ManagerInterface.php b/src/Event/Interfaces/ManagerInterface.php index 2c00c41..e9197da 100644 --- a/src/Event/Interfaces/ManagerInterface.php +++ b/src/Event/Interfaces/ManagerInterface.php @@ -39,6 +39,20 @@ public function detach( ?int $priority = null ): int; + /** + * Detach by event name & id + * + * @param string $eventName + * @param string $id + * @param int|null $priority + * @return int + */ + public function detachByEventNameId( + string $eventName, + string $id, + ?int $priority = null + ): int; + /** * Detach all events by event name * diff --git a/src/Event/Manager.php b/src/Event/Manager.php index 8b1c27c..4c3fd9b 100644 --- a/src/Event/Manager.php +++ b/src/Event/Manager.php @@ -201,16 +201,18 @@ public function has( return false; } + /** + * @inheritdoc + */ public function detach( string $eventName, $eventCallback = null, ?int $priority = null ): int { - $deleted = 0; if (!isset($this->events[$eventName])) { return 0; } - + $deleted = 0; $id = null; if ($eventCallback) { $callable = $this->generateCallableId($eventCallback); @@ -239,6 +241,34 @@ public function detach( return $deleted; } + /** + * @inheritdoc + */ + public function detachByEventNameId( + string $eventName, + string $id, + ?int $priority = null + ): int { + if (!isset($this->events[$eventName])) { + return 0; + } + $deleted = 0; + foreach ($this->events[$eventName] as $priorityId => $eventCallback) { + if ($priority !== null && $priorityId !== $priority) { + continue; + } + if (!isset($eventCallback[$id])) { + continue; + } + $deleted += count($eventCallback[$id]); + } + + return $deleted; + } + + /** + * @inheritdoc + */ public function detachAll(string ...$eventNames): int { $total = 0; diff --git a/src/HttpKernel/Traits/HttpKernelInitTrait.php b/src/HttpKernel/Traits/HttpKernelInitTrait.php index 03c839b..548471a 100644 --- a/src/HttpKernel/Traits/HttpKernelInitTrait.php +++ b/src/HttpKernel/Traits/HttpKernelInitTrait.php @@ -584,30 +584,32 @@ final public function init() : static RoutingMiddleware::class, $container )??new RoutingMiddleware($container, $this->getHttpKernel()->getRouter()); - $manager->dispatch('kernel.initConfig', $this); - } finally { - $manager->dispatch('kernel.afterInitConfig', $this); - } - - // registering debug bar - if ($environment->get('profiling') === true - && $environment->get('debugBar') === true - ) { try { - $httpKernel->addMiddleware( - ContainerHelper::resolveCallable(DebuggingMiddleware::class, $container) + $debugMiddleware = ContainerHelper::resolveCallable( + DebuggingMiddleware::class, + $container ); } catch (Throwable) { + $debugMiddleware = new DebuggingMiddleware($container); } + $manager->dispatch('kernel.initConfig', $this); + } finally { + $manager->dispatch('kernel.afterInitConfig', $this); } // do register namespace first $this->registerNameSpace(); // do register providers $this->registerProviders(); + + /*! MIDDLEWARE */ // add routing middleware on before module // to make routing executed on last $httpKernel->addMiddleware($routing); + // registering debug middleware + $httpKernel->addMiddleware($debugMiddleware); + + /*! APPS */ // do register modules $this->registerModules(); // do register schedulers diff --git a/src/Lang/README.md b/src/Lang/README.md new file mode 100644 index 0000000..0ac81ce --- /dev/null +++ b/src/Lang/README.md @@ -0,0 +1,3 @@ +# Language Directory Assets + +This directory is exclusion diff --git a/src/Lang/default.pot b/src/Lang/default.pot new file mode 100644 index 0000000..b40e212 --- /dev/null +++ b/src/Lang/default.pot @@ -0,0 +1,1790 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: TrayDigita 1.0.0\n" +"POT-Creation-Date: 2023-10-16 05:06+0700\n" +"PO-Revision-Date: 2023-09-24 19:00+0700\n" +"Last-Translator: ArrayAccess\n" +"Language-Team: ArrayAccess\n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.4\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: translate:1,3c;__;translate;trans;" +"translatePlural:1,2,5c;translatePlural:1,2;transN:1,2;_n:1,2;" +"translateContext:1,2c;transX:1,2c;_x:1,2c;translatePluralContext:1,2,4c;" +"transNX:1,2,4c;_nx:1,2,4c\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: *.css\n" +"X-Poedit-SearchPathExcluded-1: *.html\n" +"X-Poedit-SearchPathExcluded-2: *.json\n" + +#: Benchmark/Aggregator/DatabaseAggregator.php:25 +msgctxt "benchmark" +msgid "Database" +msgstr "" + +#: Benchmark/Aggregator/EventAggregator.php:44 +msgctxt "benchmark" +msgid "Event" +msgstr "" + +#: Benchmark/Aggregator/KernelAggregator.php:31 +msgctxt "benchmark" +msgid "Kernel" +msgstr "" + +#: Benchmark/Aggregator/MiddlewareAggregator.php:31 +msgctxt "benchmark" +msgid "Middleware" +msgstr "" + +#: Benchmark/Aggregator/ServicesAggregator.php:40 +msgctxt "benchmark" +msgid "Service" +msgstr "" + +#: Benchmark/Middlewares/DebuggingMiddleware.php:201 +#: Benchmark/Middlewares/DebuggingMiddleware.php:205 +#: Benchmark/Middlewares/DebuggingMiddleware.php:255 +msgctxt "benchmark" +msgid "rendered time" +msgstr "" + +#: Benchmark/Middlewares/DebuggingMiddleware.php:203 +#: Benchmark/Middlewares/DebuggingMiddleware.php:207 +#: Benchmark/Middlewares/DebuggingMiddleware.php:262 +msgctxt "benchmark" +msgid "memory usage" +msgstr "" + +#: Benchmark/Middlewares/DebuggingMiddleware.php:260 +msgctxt "benchmark" +msgid "peak memory usage" +msgstr "" + +#: Benchmark/Waterfall.php:284 Benchmark/Waterfall.php:844 +msgctxt "benchmark" +msgid "Memory" +msgstr "" + +#: Benchmark/Waterfall.php:299 +msgctxt "benchmark" +msgid "Memory usage" +msgstr "" + +#: Benchmark/Waterfall.php:315 +msgctxt "benchmark" +msgid "Real memory usage" +msgstr "" + +#: Benchmark/Waterfall.php:331 +msgctxt "benchmark" +msgid "Peak memory usage" +msgstr "" + +#: Benchmark/Waterfall.php:347 +msgctxt "benchmark" +msgid "Real Peak memory usage" +msgstr "" + +#: Benchmark/Waterfall.php:366 +msgctxt "benchmark" +msgid "Benchmark memory usage" +msgstr "" + +#: Benchmark/Waterfall.php:398 Benchmark/Waterfall.php:865 +msgctxt "benchmark" +msgid "Duration" +msgstr "" + +#: Benchmark/Waterfall.php:412 +msgctxt "benchmark" +msgid "Total duration" +msgstr "" + +#: Benchmark/Waterfall.php:425 +msgctxt "benchmark" +msgid "Benchmark duration" +msgstr "" + +#: Benchmark/Waterfall.php:438 +msgctxt "benchmark" +msgid "Application rendering duration" +msgstr "" + +#: Benchmark/Waterfall.php:454 +msgctxt "benchmark" +msgid "Total Benchmark" +msgstr "" + +#: Benchmark/Waterfall.php:481 Benchmark/Waterfall.php:483 +msgctxt "benchmark" +msgid "Benchmarks" +msgstr "" + +#: Benchmark/Waterfall.php:541 +msgctxt "benchmark" +msgid "Filter" +msgstr "" + +#: Benchmark/Waterfall.php:630 +msgctxt "benchmark" +msgid "NO BENCHMARKS" +msgstr "" + +#: Benchmark/Waterfall.php:808 +#, php-format +msgctxt "benchmark" +msgid "Total Groups: %d" +msgstr "" + +#: Benchmark/Waterfall.php:811 +#, php-format +msgctxt "benchmark" +msgid "Group : %s" +msgstr "" + +#: Benchmark/Waterfall.php:818 +msgctxt "benchmark" +msgid "Group" +msgstr "" + +#: Benchmark/Waterfall.php:837 +#, php-format +msgctxt "benchmark" +msgid "Total Memory: %s" +msgstr "" + +#: Benchmark/Waterfall.php:856 +#, php-format +msgctxt "benchmark" +msgid "Total Benchmarks Duration: %s" +msgstr "" + +#: Benchmark/Waterfall.php:878 +msgctxt "benchmark" +msgid "Waterfall" +msgstr "" + +#: Console/Command/ApplicationCheck.php:56 +msgctxt "console" +msgid "Check & validate application." +msgstr "" + +#: Console/Command/ApplicationCheck.php:62 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to validate application.\n" +"This command show information about installed application services." +msgstr "" + +#: Console/Command/ApplicationCheck.php:95 +msgctxt "console" +msgid "Application Check" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:31 +msgctxt "console" +msgid "Can not get cache object from container" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:43 +msgctxt "console" +msgid "Cache is not valid object from container" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:52 +msgctxt "console" +msgid "Cache object error" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:58 +#: Console/Command/ApplicationChecker/CacheChecker.php:94 +#: Console/Command/DatabaseChecker.php:1588 +msgctxt "console" +msgid "Error:" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:61 +#: Console/Command/ApplicationChecker/CacheChecker.php:97 +msgctxt "console" +msgid "Unknown Error" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:74 +#, php-format +msgctxt "console" +msgid "Cache object is set [%s]" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:111 +msgctxt "console" +msgid "Adapter" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:120 +msgctxt "console" +msgid "Default Lifetime" +msgstr "" + +#: Console/Command/ApplicationChecker/CacheChecker.php:136 +msgctxt "console" +msgid "Namespace" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:61 +msgctxt "console" +msgid "Config environment is not set" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:71 +#, php-format +msgctxt "console" +msgid "Debugging - error display [%s]" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:73 +#: Console/Command/ApplicationChecker/ConfigChecker.php:84 +#: Console/Command/ApplicationChecker/ConfigChecker.php:95 +msgctxt "console" +msgid "Enabled" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:74 +#: Console/Command/ApplicationChecker/ConfigChecker.php:85 +#: Console/Command/ApplicationChecker/ConfigChecker.php:96 +msgctxt "console" +msgid "Disabled" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:82 +#, php-format +msgctxt "console" +msgid "Benchmark debug bar [%s]" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:93 +#, php-format +msgctxt "console" +msgid "Benchmark profiling [%s]" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:119 +#, php-format +msgctxt "console" +msgid "Benchmarks records (%d)" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:129 +msgctxt "console" +msgid "Benchmarks group" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:190 +msgctxt "console" +msgid "App directory is not exists" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:196 +msgctxt "console" +msgid "Required Applications directory" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:208 +msgctxt "console" +msgid "Storage directory is not writable" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:223 +msgctxt "console" +msgid "directory" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:250 +#, php-format +msgctxt "console" +msgid "Configuration file is not a valid file (%s)" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:254 +#, php-format +msgctxt "console" +msgid "Configuration file is invalid (%s)" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:258 +#, php-format +msgctxt "console" +msgid "Configuration file is empty (%s)" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:262 +#, php-format +msgctxt "console" +msgid "Configuration file does not exists (%s)" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:274 +#: Console/Command/ApplicationChecker/ConfigChecker.php:354 +msgctxt "console" +msgid "Configuration" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:286 +msgctxt "console" +msgid "Configuration file is not exists on container" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:296 +msgctxt "console" +msgid "Configuration file does not contain database configuration" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:313 +msgctxt "console" +msgid "Configuration file does not contain valid database configuration" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:325 +msgctxt "console" +msgid "Configuration file does not contain security configuration" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:336 +msgctxt "console" +msgid "Configuration file does not contain valid security configuration" +msgstr "" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:346 +msgctxt "console" +msgid "Configuration file is exist & valid" +msgstr "" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:23 +msgctxt "console" +msgid "Container object not set" +msgstr "" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:30 +#, php-format +msgctxt "console" +msgid "Container object is set [%s]" +msgstr "" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:46 +#, php-format +msgctxt "console" +msgid "Registered Container (%d)" +msgstr "" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:67 +#, php-format +msgctxt "console" +msgid "Registered Aliases (%d)" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:37 +msgctxt "console" +msgid "Php version" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:63 +msgctxt "console" +msgid "extension is not exist" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:74 +msgctxt "console" +msgid "extension valid" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:78 +msgctxt "console" +msgid "with version" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:87 +msgctxt "console" +msgid "All required extensions are installed" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:98 +msgctxt "console" +msgid "required extensions is not installed" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:143 +msgctxt "console" +msgid "extension installed" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:151 +msgctxt "console" +msgid "No recommended extensions installed" +msgstr "" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:162 +msgctxt "console" +msgid "recommended extension installed" +msgid_plural "recommended extensions installed" +msgstr[0] "" +msgstr[1] "" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:25 +msgctxt "console" +msgid "Can not get translator object from container" +msgstr "" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:40 +msgctxt "console" +msgid "Translator is not valid object from container" +msgstr "" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:51 +msgctxt "console" +msgid "Translator object is set" +msgstr "" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:61 +msgctxt "console" +msgid "No Adapter Registered" +msgstr "" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:66 +#, php-format +msgctxt "console" +msgid "Registered Adapters (%d)" +msgstr "" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:90 +msgctxt "console" +msgid "Current Language" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:90 +msgctxt "console" +msgid "Create temporary php builtin web server." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:99 +msgctxt "console" +msgid "Port number that used for listening server" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:109 +msgctxt "console" +msgid "Host that used to listening server." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:123 +msgctxt "console" +msgid "Public index.php file." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:128 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create temporary php builtin web server like:\n" +"\n" +" %s\n" +"\n" +"You can use %s\n" +"\n" +"Host accept local %s\n" +"Port accept range between %s" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:139 +msgctxt "console" +msgid "port number" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:143 +#: Console/Command/BuiltInWebServer.php:147 +msgctxt "console" +msgid "default" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:170 +#: Console/Command/BuiltInWebServer.php:188 +#: Console/Command/BuiltInWebServer.php:223 +#: Console/Command/BuiltInWebServer.php:256 +#: Console/Command/BuiltInWebServer.php:273 +#: Console/Command/BuiltInWebServer.php:340 +#: Console/Command/BuiltInWebServer.php:357 +#: Console/Command/BuiltInWebServer.php:374 +#: Console/Command/BuiltInWebServer.php:391 +#: Console/Command/BuiltInWebServer.php:457 +#: Console/Command/BuiltInWebServer.php:558 +#, php-format +msgctxt "console" +msgid "Command %s Error!" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:176 +msgctxt "console" +msgid "Port is Invalid! option port must be numeric." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:195 +#, php-format +msgctxt "console" +msgid "Port is Invalid! option port should not use: %s" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:207 +#, php-format +msgctxt "console" +msgid "Typically this port used by %s application." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:230 +#, php-format +msgctxt "console" +msgid "Port is out of range! option port must be between: %s to %s" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:262 +msgctxt "console" +msgid "" +"Option host is invalid. Host only accept \"localhost\" and local IP address." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:280 +#, php-format +msgctxt "console" +msgid "Option host is invalid. IP %s is not a local IP address." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:346 +msgctxt "console" +msgid "Could not detect public root file." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:363 +msgctxt "console" +msgid "Public root file is not in application directory!" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:380 +msgctxt "console" +msgid "Could not detect php binary executable file." +msgstr "" + +#: Console/Command/BuiltInWebServer.php:396 +msgctxt "console" +msgid "Function [exec] is not exist" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:421 +msgctxt "console" +msgid "Checking" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:429 +msgctxt "console" +msgid "Port" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:466 +#, php-format +msgctxt "console" +msgid "Can not determine port that can be used after doing %s tests" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:475 +#, php-format +msgctxt "console" +msgid "Can not listening %s with port %s" +msgstr "" + +#: Console/Command/BuiltInWebServer.php:531 +#, php-format +msgctxt "console" +msgid "Press %s to exit." +msgstr "" + +#: Console/Command/ChecksumGenerator.php:59 +msgctxt "console" +msgid "Create list of core file checksums." +msgstr "" + +#: Console/Command/ChecksumGenerator.php:68 +msgctxt "console" +msgid "Display checksums on terminal without writing to disk" +msgstr "" + +#: Console/Command/ChecksumGenerator.php:78 +#, php-format +msgctxt "console" +msgid "The %s creating checksum files on %s directory." +msgstr "" + +#: Console/Command/ChecksumGenerator.php:121 +#, php-format +msgctxt "console" +msgid "Files will be put in directory: %s" +msgstr "" + +#: Console/Command/ChecksumGenerator.php:133 +#: Console/Command/CommandGenerator.php:329 +#: Console/Command/ControllerGenerator.php:292 +#: Console/Command/DatabaseChecker.php:1255 +#: Console/Command/DatabaseChecker.php:1397 +#: Console/Command/DatabaseEventGenerator.php:329 +#: Console/Command/EntityGenerator.php:325 +#: Console/Command/MiddlewareGenerator.php:311 +#: Console/Command/ModuleGenerator.php:344 +#: Console/Command/SchedulerGenerator.php:349 +msgctxt "console" +msgid "Are you sure to continue (Yes/No)?" +msgstr "" + +#: Console/Command/ChecksumGenerator.php:148 +#: Console/Command/CommandGenerator.php:342 +#: Console/Command/ControllerGenerator.php:305 +#: Console/Command/DatabaseChecker.php:1270 +#: Console/Command/DatabaseChecker.php:1412 +#: Console/Command/DatabaseEventGenerator.php:342 +#: Console/Command/EntityGenerator.php:338 +#: Console/Command/MiddlewareGenerator.php:326 +#: Console/Command/ModuleGenerator.php:359 +#: Console/Command/SchedulerGenerator.php:362 +msgctxt "console" +msgid "Please enter valid answer! (Yes / No)" +msgstr "" + +#: Console/Command/ChecksumGenerator.php:160 +#: Console/Command/CommandGenerator.php:386 +#: Console/Command/ControllerGenerator.php:347 +#: Console/Command/DatabaseChecker.php:1282 +#: Console/Command/DatabaseChecker.php:1426 +#: Console/Command/DatabaseEventGenerator.php:386 +#: Console/Command/EntityGenerator.php:383 +#: Console/Command/MiddlewareGenerator.php:370 +#: Console/Command/ModuleGenerator.php:403 +#: Console/Command/SchedulerGenerator.php:408 +msgctxt "console" +msgid "Operation cancelled!" +msgstr "" + +#: Console/Command/ChecksumGenerator.php:271 +msgctxt "console" +msgid "Done!" +msgstr "" + +#: Console/Command/ChecksumGenerator.php:283 +msgctxt "console" +msgid "Source" +msgstr "" + +#: Console/Command/CommandGenerator.php:79 +msgctxt "console" +msgid "Generate command class." +msgstr "" + +#: Console/Command/CommandGenerator.php:85 +#: Console/Command/ControllerGenerator.php:88 +#: Console/Command/DatabaseEventGenerator.php:89 +#: Console/Command/EntityGenerator.php:85 +#: Console/Command/MiddlewareGenerator.php:85 +#: Console/Command/ModuleGenerator.php:85 +#: Console/Command/SchedulerGenerator.php:85 +msgctxt "console" +msgid "Print generated class file only" +msgstr "" + +#: Console/Command/CommandGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Command will use prefix namespace with %s\n" +"Command only support single class name.\n" +msgstr "" + +#: Console/Command/CommandGenerator.php:174 +msgctxt "console" +msgid "Please enter command class name" +msgstr "" + +#: Console/Command/CommandGenerator.php:181 +msgctxt "console" +msgid "Please enter valid command class name!" +msgstr "" + +#: Console/Command/CommandGenerator.php:192 +#, php-format +msgctxt "console" +msgid "Command [%s] is invalid! class name contain reserved keyword!" +msgstr "" + +#: Console/Command/CommandGenerator.php:203 +#, php-format +msgctxt "console" +msgid "" +"Command [%s] is invalid! Command only contain single class name, not " +"namespaced!" +msgstr "" + +#: Console/Command/CommandGenerator.php:214 +#, php-format +msgctxt "console" +msgid "Command [%s] is too long! Must be less or equal 128 characters" +msgstr "" + +#: Console/Command/CommandGenerator.php:224 +#, php-format +msgctxt "console" +msgid "Command [%s] exist" +msgstr "" + +#: Console/Command/CommandGenerator.php:254 +#, php-format +msgctxt "console" +msgid "%s Could not detect command directory" +msgstr "" + +#: Console/Command/CommandGenerator.php:268 +#: Console/Command/ControllerGenerator.php:238 +#: Console/Command/DatabaseEventGenerator.php:269 +#: Console/Command/EntityGenerator.php:253 +#: Console/Command/MiddlewareGenerator.php:250 +#: Console/Command/ModuleGenerator.php:268 +#: Console/Command/SchedulerGenerator.php:272 +#, php-format +msgctxt "console" +msgid "%s generator only support in interactive mode" +msgstr "" + +#: Console/Command/CommandGenerator.php:292 +#, php-format +msgctxt "console" +msgid "Command Name : %s" +msgstr "" + +#: Console/Command/CommandGenerator.php:305 +#, php-format +msgctxt "console" +msgid "Command Class : %s" +msgstr "" + +#: Console/Command/CommandGenerator.php:317 +#, php-format +msgctxt "console" +msgid "Command File : %s" +msgstr "" + +#: Console/Command/CommandGenerator.php:364 +#, php-format +msgctxt "console" +msgid "%s Could not save command!" +msgstr "" + +#: Console/Command/CommandGenerator.php:375 +#, php-format +msgctxt "console" +msgid "%s Command successfully created!" +msgstr "" + +#: Console/Command/ControllerGenerator.php:80 +msgctxt "console" +msgid "Generate controller class." +msgstr "" + +#: Console/Command/ControllerGenerator.php:94 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create controller object.\n" +"Controller will use prefix namespace with %s\n" +"Character slash %s, hyphen %s and underscore %s\n" +"Will converted into namespace separator" +msgstr "" + +#: Console/Command/ControllerGenerator.php:160 +msgctxt "console" +msgid "Please enter controller name" +msgstr "" + +#: Console/Command/ControllerGenerator.php:166 +msgctxt "console" +msgid "Please enter valid controller name!" +msgstr "" + +#: Console/Command/ControllerGenerator.php:173 +#, php-format +msgctxt "console" +msgid "Controller [%s] is too long! Must be less or equal 5 namespaces" +msgstr "" + +#: Console/Command/ControllerGenerator.php:184 +#, php-format +msgctxt "console" +msgid "Controller [%s] is invalid! class name contain reserved keyword!" +msgstr "" + +#: Console/Command/ControllerGenerator.php:194 +#, php-format +msgctxt "console" +msgid "Controller [%s] exist" +msgstr "" + +#: Console/Command/ControllerGenerator.php:224 +#, php-format +msgctxt "console" +msgid "%s Could not detect controller directory" +msgstr "" + +#: Console/Command/ControllerGenerator.php:260 +#, php-format +msgctxt "console" +msgid "Controller Name : %s" +msgstr "" + +#: Console/Command/ControllerGenerator.php:271 +#, php-format +msgctxt "console" +msgid "Controller Class : %s" +msgstr "" + +#: Console/Command/ControllerGenerator.php:282 +#, php-format +msgctxt "console" +msgid "Controller File : %s" +msgstr "" + +#: Console/Command/ControllerGenerator.php:325 +#, php-format +msgctxt "console" +msgid "%s Could not save controller!" +msgstr "" + +#: Console/Command/ControllerGenerator.php:336 +#, php-format +msgctxt "console" +msgid "%s Controller successfully created!" +msgstr "" + +#: Console/Command/DatabaseChecker.php:85 +msgctxt "console" +msgid "Check & validate database." +msgstr "" + +#: Console/Command/DatabaseChecker.php:93 +msgctxt "console" +msgid "Validate changed / difference about database schema" +msgstr "" + +#: Console/Command/DatabaseChecker.php:104 +#, php-format +msgctxt "console" +msgid "Print sql query create schema (should execute with %s command)" +msgstr "" + +#: Console/Command/DatabaseChecker.php:120 +#, php-format +msgctxt "console" +msgid "Dump create schema (should execute with %s & %s command)" +msgstr "" + +#: Console/Command/DatabaseChecker.php:140 +#, php-format +msgctxt "console" +msgid "" +"Execute query sql that from new schema into database (should execute with %s " +"command)" +msgstr "" + +#: Console/Command/DatabaseChecker.php:156 +#, php-format +msgctxt "console" +msgid "Optimize database when possible (should execute with %s command)" +msgstr "" + +#: Console/Command/DatabaseChecker.php:170 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to validate database.\n" +"This command show information about installed database & configuration " +"services." +msgstr "" + +#: Console/Command/DatabaseChecker.php:248 +#: Console/Command/DatabaseChecker.php:1545 +msgctxt "console" +msgid "Can not get database object from container" +msgstr "" + +#: Console/Command/DatabaseChecker.php:259 +#: Console/Command/DatabaseChecker.php:1557 +msgctxt "console" +msgid "Database connection is not valid object from container" +msgstr "" + +#: Console/Command/DatabaseChecker.php:364 +msgctxt "console" +msgid "No schema can be created" +msgstr "" + +#: Console/Command/DatabaseChecker.php:396 +#: Console/Command/DatabaseChecker.php:1360 +#: Console/Command/DatabaseChecker.php:1371 +msgctxt "console" +msgid "No change into database schema" +msgstr "" + +#: Console/Command/DatabaseChecker.php:426 +#: Console/Command/DatabaseChecker.php:439 +#, php-format +msgctxt "console" +msgid "Table \"%s\" does not exist!" +msgstr "" + +#: Console/Command/DatabaseChecker.php:464 +#, php-format +msgctxt "console" +msgid "Table \"%s\" %s" +msgstr "" + +#: Console/Command/DatabaseChecker.php:475 +msgctxt "console" +msgid "no difference" +msgstr "" + +#: Console/Command/DatabaseChecker.php:480 +#: Console/Command/DatabaseChecker.php:505 +#: Console/Command/DatabaseChecker.php:1918 +msgctxt "console" +msgid "NEED TO OPTIMIZE" +msgstr "" + +#: Console/Command/DatabaseChecker.php:497 +#, php-format +msgctxt "console" +msgid "Table \"%s\" need to be change" +msgstr "" + +#: Console/Command/DatabaseChecker.php:534 +#: Console/Command/DatabaseChecker.php:556 +#: Console/Command/DatabaseChecker.php:578 +#: Console/Command/DatabaseChecker.php:600 +#: Console/Command/DatabaseChecker.php:622 +#: Console/Command/DatabaseChecker.php:644 +#: Console/Command/DatabaseChecker.php:666 +#: Console/Command/DatabaseChecker.php:688 +#: Console/Command/DatabaseChecker.php:713 +#: Console/Command/DatabaseChecker.php:735 +msgctxt "console" +msgid "Column" +msgstr "" + +#: Console/Command/DatabaseChecker.php:536 +msgctxt "console" +msgid "type" +msgstr "" + +#: Console/Command/DatabaseChecker.php:538 +#: Console/Command/DatabaseChecker.php:560 +#: Console/Command/DatabaseChecker.php:582 +#: Console/Command/DatabaseChecker.php:604 +#: Console/Command/DatabaseChecker.php:626 +#: Console/Command/DatabaseChecker.php:648 +#: Console/Command/DatabaseChecker.php:670 +#: Console/Command/DatabaseChecker.php:693 +#: Console/Command/DatabaseChecker.php:717 +#: Console/Command/DatabaseChecker.php:739 +#, php-format +msgctxt "console" +msgid "change from: [%s] to [%s]" +msgstr "" + +#: Console/Command/DatabaseChecker.php:558 +msgctxt "console" +msgid "default value" +msgstr "" + +#: Console/Command/DatabaseChecker.php:690 +msgctxt "console" +msgid "scale" +msgstr "" + +#: Console/Command/DatabaseChecker.php:737 +msgctxt "console" +msgid "comment" +msgstr "" + +#: Console/Command/DatabaseChecker.php:760 +msgctxt "console" +msgid "Added Column" +msgstr "" + +#: Console/Command/DatabaseChecker.php:771 +msgctxt "console" +msgid "Removed Column" +msgstr "" + +#: Console/Command/DatabaseChecker.php:782 +msgctxt "console" +msgid "Renamed Column" +msgstr "" + +#: Console/Command/DatabaseChecker.php:784 +#, php-format +msgctxt "console" +msgid "from [%s] to [%s]" +msgstr "" + +#: Console/Command/DatabaseChecker.php:807 +msgctxt "console" +msgid "Modify Index" +msgstr "" + +#: Console/Command/DatabaseChecker.php:809 +#, php-format +msgctxt "console" +msgid "from %s to %s" +msgstr "" + +#: Console/Command/DatabaseChecker.php:842 +msgctxt "console" +msgid "Added Index" +msgstr "" + +#: Console/Command/DatabaseChecker.php:860 +msgctxt "console" +msgid "Removed Index" +msgstr "" + +#: Console/Command/DatabaseChecker.php:880 +msgctxt "console" +msgid "Renamed Index" +msgstr "" + +#: Console/Command/DatabaseChecker.php:901 +msgctxt "console" +msgid "Modify ForeignKey" +msgstr "" + +#: Console/Command/DatabaseChecker.php:947 +msgctxt "console" +msgid "Added ForeignKey" +msgstr "" + +#: Console/Command/DatabaseChecker.php:969 +msgctxt "console" +msgid "Removed ForeignKey" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1006 +#: Console/Command/DatabaseChecker.php:1039 +#: Console/Command/DatabaseChecker.php:1073 +#, php-format +msgctxt "console" +msgid "Table \"%s\" for %s & does not exist in schema" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1101 +#, php-format +msgctxt "console" +msgid "Table \"%s\" for %s" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1148 +msgctxt "console" +msgid "Contains changed database schema, you can execute command :" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1173 +#: Console/Command/DatabaseChecker.php:1971 +msgctxt "console" +msgid "" +"Contains database table that can be optimized, you can execute command :" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1201 +msgctxt "console" +msgid "There are no tables that can be optimized" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1216 +#, php-format +msgctxt "console" +msgid "%s does not yet support optimization" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1237 +#, php-format +msgctxt "console" +msgid "Table \"%s\" can be freed up to : (%s)" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1291 +#: Console/Command/DatabaseChecker.php:1439 +msgctxt "console" +msgid "PLEASE DO NOT CANCEL OPERATION!" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1299 +msgctxt "console" +msgid "Optimizing table" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1328 +msgctxt "console" +msgid "FAIL" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1338 +#: Console/Command/DatabaseChecker.php:1527 +msgctxt "console" +msgid "ALL DONE!" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1381 +msgctxt "console" +msgid "Executed Command:" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1465 +msgctxt "console" +msgid "Executing:" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1483 +#: Console/Command/DatabaseChecker.php:1512 +msgctxt "console" +msgid "Failed to execute command" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1582 +msgctxt "console" +msgid "Database connection error." +msgstr "" + +#: Console/Command/DatabaseChecker.php:1600 +msgctxt "console" +msgid "Database connection succeed" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1638 +msgctxt "console" +msgid "Database name" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1655 +msgctxt "console" +msgid "Database host" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1664 +msgctxt "console" +msgid "Database user" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1673 +msgctxt "console" +msgid "Database password" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1695 +msgctxt "console" +msgid "Unknown" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1704 +msgctxt "console" +msgid "Connection Object Info" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1712 +msgctxt "console" +msgid "Connection" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1766 +msgctxt "console" +msgid "ORM Configuration" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1772 +msgctxt "console" +msgid "Query Cache" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1773 +msgctxt "console" +msgid "Result Cache" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1774 +msgctxt "console" +msgid "Proxy Namespace" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1775 +msgctxt "console" +msgid "Proxy Directory" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1776 +msgctxt "console" +msgid "Metadata Driver" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1777 +msgctxt "console" +msgid "Repository Factory" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1778 +msgctxt "console" +msgid "Quote Strategy" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1779 +msgctxt "console" +msgid "Naming Factory" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1780 +msgctxt "console" +msgid "Schema Manager Factory" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1789 +msgctxt "console" +msgid "Not Set" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1799 +msgctxt "console" +msgid "Registered Schema / Entities" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1932 +msgctxt "console" +msgid "Changing" +msgstr "" + +#: Console/Command/DatabaseChecker.php:1946 +msgctxt "console" +msgid "Contains changed database schema, you can check with command :" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:83 +msgctxt "console" +msgid "Generate database event class." +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:94 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Database Event will use prefix namespace with %s\n" +"Database Event only support single class name." +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:178 +msgctxt "console" +msgid "Please enter database event class name" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:184 +msgctxt "console" +msgid "Please enter valid database event class name!" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:193 +#, php-format +msgctxt "console" +msgid "Event [%s] is invalid! class name contain reserved keyword!" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:204 +#, php-format +msgctxt "console" +msgid "" +"Event [%s] is invalid! Database event only contain single class name, not " +"namespaced!" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:215 +#, php-format +msgctxt "console" +msgid "Database event [%s] is too long! Must be less or equal 128 characters" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:225 +#, php-format +msgctxt "console" +msgid "Database event [%s] exist" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:255 +#, php-format +msgctxt "console" +msgid "%s Could not detect database event directory" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:292 +#, php-format +msgctxt "console" +msgid "Database Event Name : %s" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:305 +#, php-format +msgctxt "console" +msgid "DatabaseEvent Class : %s" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:317 +#, php-format +msgctxt "console" +msgid "DatabaseEvent File : %s" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:364 +#, php-format +msgctxt "console" +msgid "%s Could not save databaseEvent!" +msgstr "" + +#: Console/Command/DatabaseEventGenerator.php:375 +#, php-format +msgctxt "console" +msgid "%s DatabaseEvent successfully created!" +msgstr "" + +#: Console/Command/EntityGenerator.php:79 +msgctxt "console" +msgid "Generate entity class." +msgstr "" + +#: Console/Command/EntityGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Entity will use prefix namespace with %s\n" +msgstr "" + +#: Console/Command/EntityGenerator.php:173 +msgctxt "console" +msgid "Please enter entity name" +msgstr "" + +#: Console/Command/EntityGenerator.php:179 +msgctxt "console" +msgid "Please enter valid entity name!" +msgstr "" + +#: Console/Command/EntityGenerator.php:188 +#, php-format +msgctxt "console" +msgid "Entity [%s] is invalid! class name contain reserved keyword!" +msgstr "" + +#: Console/Command/EntityGenerator.php:199 +#, php-format +msgctxt "console" +msgid "Table name [%s] is too long! Must be less or equal 64 characters" +msgstr "" + +#: Console/Command/EntityGenerator.php:209 +#, php-format +msgctxt "console" +msgid "Entity [%s] exist" +msgstr "" + +#: Console/Command/EntityGenerator.php:239 +#, php-format +msgctxt "console" +msgid "%s Could not detect entity directory" +msgstr "" + +#: Console/Command/EntityGenerator.php:276 +#, php-format +msgctxt "console" +msgid "Entity Name : %s" +msgstr "" + +#: Console/Command/EntityGenerator.php:288 +#, php-format +msgctxt "console" +msgid "Table Name : %s" +msgstr "" + +#: Console/Command/EntityGenerator.php:301 +#, php-format +msgctxt "console" +msgid "Entity Class : %s" +msgstr "" + +#: Console/Command/EntityGenerator.php:313 +#, php-format +msgctxt "console" +msgid "Entity File : %s" +msgstr "" + +#: Console/Command/EntityGenerator.php:361 +#, php-format +msgctxt "console" +msgid "%s Could not save entity!" +msgstr "" + +#: Console/Command/EntityGenerator.php:372 +#, php-format +msgctxt "console" +msgid "%s Entity successfully created!" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:79 +msgctxt "console" +msgid "Generate middleware class." +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Middleware will use prefix namespace with %s\n" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:174 +msgctxt "console" +msgid "Please enter middleware class name" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:183 +msgctxt "console" +msgid "Please enter valid middleware class name!" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:193 +#, php-format +msgctxt "console" +msgid "Middleware [%s] is invalid! class name contain reserved keyword!" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:204 +#, php-format +msgctxt "console" +msgid "Middleware [%s] exist" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:236 +#, php-format +msgctxt "console" +msgid "%s Could not detect middleware directory" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:272 +#, php-format +msgctxt "console" +msgid "Middleware Name : %s" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:286 +#, php-format +msgctxt "console" +msgid "Middleware Class : %s" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:298 +#, php-format +msgctxt "console" +msgid "Middleware File : %s" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:348 +#, php-format +msgctxt "console" +msgid "%s Could not save middleware!" +msgstr "" + +#: Console/Command/MiddlewareGenerator.php:359 +#, php-format +msgctxt "console" +msgid "%s Middleware successfully created!" +msgstr "" + +#: Console/Command/ModuleGenerator.php:79 +msgctxt "console" +msgid "Generate module class." +msgstr "" + +#: Console/Command/ModuleGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Module will use prefix namespace with %s\n" +"Module only support single class name.\n" +msgstr "" + +#: Console/Command/ModuleGenerator.php:174 +msgctxt "console" +msgid "Please enter module class name" +msgstr "" + +#: Console/Command/ModuleGenerator.php:181 +msgctxt "console" +msgid "Please enter valid module class name!" +msgstr "" + +#: Console/Command/ModuleGenerator.php:192 +#, php-format +msgctxt "console" +msgid "Module [%s] is invalid! class name contain reserved keyword!" +msgstr "" + +#: Console/Command/ModuleGenerator.php:203 +#, php-format +msgctxt "console" +msgid "" +"Module [%s] is invalid! Module only contain single class name, not " +"namespaced!" +msgstr "" + +#: Console/Command/ModuleGenerator.php:214 +#, php-format +msgctxt "console" +msgid "Module [%s] is too long! Must be less or equal 128 characters" +msgstr "" + +#: Console/Command/ModuleGenerator.php:224 +#, php-format +msgctxt "console" +msgid "Module [%s] exist" +msgstr "" + +#: Console/Command/ModuleGenerator.php:254 +#, php-format +msgctxt "console" +msgid "%s Could not detect module directory" +msgstr "" + +#: Console/Command/ModuleGenerator.php:293 +#, php-format +msgctxt "console" +msgid "Module Name : %s" +msgstr "" + +#: Console/Command/ModuleGenerator.php:307 +#, php-format +msgctxt "console" +msgid "Module Class : %s" +msgstr "" + +#: Console/Command/ModuleGenerator.php:319 +#, php-format +msgctxt "console" +msgid "Module Namespace : %s" +msgstr "" + +#: Console/Command/ModuleGenerator.php:331 +#, php-format +msgctxt "console" +msgid "Module File : %s" +msgstr "" + +#: Console/Command/ModuleGenerator.php:381 +#, php-format +msgctxt "console" +msgid "%s Could not save module!" +msgstr "" + +#: Console/Command/ModuleGenerator.php:392 +#, php-format +msgctxt "console" +msgid "%s Module successfully created!" +msgstr "" + +#: Console/Command/SchedulerAction.php:38 +msgctxt "console" +msgid "List or run scheduler." +msgstr "" + +#: Console/Command/SchedulerAction.php:45 +msgctxt "console" +msgid "Run the pending schedulers" +msgstr "" + +#: Console/Command/SchedulerAction.php:51 +#, php-format +msgctxt "console" +msgid "The %s help you to list & run scheduler" +msgstr "" + +#: Console/Command/SchedulerAction.php:78 +msgctxt "console" +msgid "Object scheduler is not valid" +msgstr "" + +#: Console/Command/SchedulerAction.php:102 +msgctxt "console" +msgid "No task in queue" +msgstr "" + +#: Console/Command/SchedulerAction.php:112 +#, php-format +msgctxt "console" +msgid "Executing %s task" +msgid_plural "Executing %s tasks" +msgstr[0] "" +msgstr[1] "" + +#: Console/Command/SchedulerAction.php:131 +msgctxt "console" +msgid "scheduler in queue to run" +msgid_plural "schedulers in queue to run" +msgstr[0] "" +msgstr[1] "" + +#: Console/Command/SchedulerAction.php:144 +#: Console/Command/SchedulerAction.php:190 +#, php-format +msgctxt "console" +msgid "run every %s seconds" +msgstr "" + +#: Console/Command/SchedulerAction.php:152 +#: Console/Command/SchedulerAction.php:198 +#, php-format +msgctxt "console" +msgid "next executed time %s" +msgstr "" + +#: Console/Command/SchedulerAction.php:177 +msgctxt "console" +msgid "scheduler skipped" +msgid_plural "schedulers skipped" +msgstr[0] "" +msgstr[1] "" + +#: Console/Command/SchedulerGenerator.php:79 +msgctxt "console" +msgid "Generate scheduler class." +msgstr "" + +#: Console/Command/SchedulerGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Scheduler will use prefix namespace with %s\n" +"Scheduler only support single class name.\n" +"\n" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:174 +msgctxt "console" +msgid "Please enter scheduler class name" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:181 +msgctxt "console" +msgid "Please enter valid scheduler class name!" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:192 +#, php-format +msgctxt "console" +msgid "Scheduler [%s] is invalid! class name contain reserved keyword!" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:203 +#, php-format +msgctxt "console" +msgid "" +"Scheduler [%s] is invalid! Scheduler only contain single class name, not " +"namespaced!" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:214 +#, php-format +msgctxt "console" +msgid "Scheduler [%s] is too long! Must be less or equal 128 characters" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:225 +#, php-format +msgctxt "console" +msgid "Scheduler [%s] exist" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:258 +#, php-format +msgctxt "console" +msgid "%s Could not detect scheduler directory" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:300 +#, php-format +msgctxt "console" +msgid "Scheduler Name : %s" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:312 +#, php-format +msgctxt "console" +msgid "Scheduler Identity : %s" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:325 +#, php-format +msgctxt "console" +msgid "Scheduler Class : %s" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:337 +#, php-format +msgctxt "console" +msgid "Scheduler File : %s" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:386 +#, php-format +msgctxt "console" +msgid "%s Could not save scheduler!" +msgstr "" + +#: Console/Command/SchedulerGenerator.php:397 +#, php-format +msgctxt "console" +msgid "%s Scheduler successfully created!" +msgstr "" + +#: Console/Command/Traits/WriterHelperTrait.php:143 +#, php-format +msgctxt "console" +msgid "Time %s secs; Memory Usage: %s; Memory Peak Usage: %s" +msgstr "" + +#: Templates/Template.php:208 +msgctxt "template" +msgid "version" +msgstr "" + +#: Templates/Template.php:209 +msgctxt "template" +msgid "unknown" +msgstr "" diff --git a/src/Lang/id.po b/src/Lang/id.po new file mode 100644 index 0000000..1f8ef57 --- /dev/null +++ b/src/Lang/id.po @@ -0,0 +1,1855 @@ +msgid "" +msgstr "" +"Project-Id-Version: TrayDigita 1.0.0\n" +"POT-Creation-Date: 2023-10-16 05:06+0700\n" +"PO-Revision-Date: 2023-10-16 06:07+0700\n" +"Last-Translator: \n" +"Language-Team: ArrayAccess\n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.4\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: translate:1,3c;__;translate;trans;" +"translatePlural:1,2,5c;translatePlural:1,2;transN:1,2;_n:1,2;" +"translateContext:1,2c;transX:1,2c;_x:1,2c;translatePluralContext:1,2,4c;" +"transNX:1,2,4c;_nx:1,2,4c\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: *.css\n" +"X-Poedit-SearchPathExcluded-1: *.html\n" +"X-Poedit-SearchPathExcluded-2: *.json\n" + +#: Benchmark/Aggregator/DatabaseAggregator.php:25 +msgctxt "benchmark" +msgid "Database" +msgstr "Basis Data" + +#: Benchmark/Aggregator/EventAggregator.php:44 +msgctxt "benchmark" +msgid "Event" +msgstr "Acara" + +#: Benchmark/Aggregator/KernelAggregator.php:31 +msgctxt "benchmark" +msgid "Kernel" +msgstr "Kernel" + +#: Benchmark/Aggregator/MiddlewareAggregator.php:31 +msgctxt "benchmark" +msgid "Middleware" +msgstr "Middleware" + +#: Benchmark/Aggregator/ServicesAggregator.php:40 +msgctxt "benchmark" +msgid "Service" +msgstr "Layanan" + +#: Benchmark/Middlewares/DebuggingMiddleware.php:201 +#: Benchmark/Middlewares/DebuggingMiddleware.php:205 +#: Benchmark/Middlewares/DebuggingMiddleware.php:255 +msgctxt "benchmark" +msgid "rendered time" +msgstr "waktu pemuatan" + +#: Benchmark/Middlewares/DebuggingMiddleware.php:203 +#: Benchmark/Middlewares/DebuggingMiddleware.php:207 +#: Benchmark/Middlewares/DebuggingMiddleware.php:262 +msgctxt "benchmark" +msgid "memory usage" +msgstr "penggunaan memori" + +#: Benchmark/Middlewares/DebuggingMiddleware.php:260 +msgctxt "benchmark" +msgid "peak memory usage" +msgstr "penggunaan puncak memori" + +#: Benchmark/Waterfall.php:284 Benchmark/Waterfall.php:844 +msgctxt "benchmark" +msgid "Memory" +msgstr "Memori" + +#: Benchmark/Waterfall.php:299 +msgctxt "benchmark" +msgid "Memory usage" +msgstr "Penggunaan memori" + +#: Benchmark/Waterfall.php:315 +msgctxt "benchmark" +msgid "Real memory usage" +msgstr "Pengginaan memori asli" + +#: Benchmark/Waterfall.php:331 +msgctxt "benchmark" +msgid "Peak memory usage" +msgstr "Penggunaan puncak memori" + +#: Benchmark/Waterfall.php:347 +msgctxt "benchmark" +msgid "Real Peak memory usage" +msgstr "Penggunaan Puncak Memori sebenarnya" + +#: Benchmark/Waterfall.php:366 +msgctxt "benchmark" +msgid "Benchmark memory usage" +msgstr "Penggunaan Memori Benchmark" + +#: Benchmark/Waterfall.php:398 Benchmark/Waterfall.php:865 +msgctxt "benchmark" +msgid "Duration" +msgstr "Durasi" + +#: Benchmark/Waterfall.php:412 +msgctxt "benchmark" +msgid "Total duration" +msgstr "Total durasi" + +#: Benchmark/Waterfall.php:425 +msgctxt "benchmark" +msgid "Benchmark duration" +msgstr "Durasi benchmark" + +#: Benchmark/Waterfall.php:438 +msgctxt "benchmark" +msgid "Application rendering duration" +msgstr "Durasi pemuatan aplikasi" + +#: Benchmark/Waterfall.php:454 +msgctxt "benchmark" +msgid "Total Benchmark" +msgstr "Total Benchmark" + +#: Benchmark/Waterfall.php:481 Benchmark/Waterfall.php:483 +msgctxt "benchmark" +msgid "Benchmarks" +msgstr "Benchmarks" + +#: Benchmark/Waterfall.php:541 +msgctxt "benchmark" +msgid "Filter" +msgstr "Saring" + +#: Benchmark/Waterfall.php:630 +msgctxt "benchmark" +msgid "NO BENCHMARKS" +msgstr "TIDAK ADA BENCHMARK" + +#: Benchmark/Waterfall.php:808 +#, php-format +msgctxt "benchmark" +msgid "Total Groups: %d" +msgstr "Total Grup: %d" + +#: Benchmark/Waterfall.php:811 +#, php-format +msgctxt "benchmark" +msgid "Group : %s" +msgstr "Grup : %s" + +#: Benchmark/Waterfall.php:818 +msgctxt "benchmark" +msgid "Group" +msgstr "Grup" + +#: Benchmark/Waterfall.php:837 +#, php-format +msgctxt "benchmark" +msgid "Total Memory: %s" +msgstr "Total Memori: %s" + +#: Benchmark/Waterfall.php:856 +#, php-format +msgctxt "benchmark" +msgid "Total Benchmarks Duration: %s" +msgstr "Total Durasi Benchmark: %s" + +#: Benchmark/Waterfall.php:878 +msgctxt "benchmark" +msgid "Waterfall" +msgstr "Waterfall" + +#: Console/Command/ApplicationCheck.php:56 +msgctxt "console" +msgid "Check & validate application." +msgstr "Periksa & validasi aplikasi." + +#: Console/Command/ApplicationCheck.php:62 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to validate application.\n" +"This command show information about installed application services." +msgstr "" +"%s membantu Anda memvalidasi aplikasi.\n" +"Perintah ini menampilkan informasi tentang layanan aplikasi yang terinstall." + +#: Console/Command/ApplicationCheck.php:95 +msgctxt "console" +msgid "Application Check" +msgstr "Pemeriksa Aplikasi" + +#: Console/Command/ApplicationChecker/CacheChecker.php:31 +msgctxt "console" +msgid "Can not get cache object from container" +msgstr "Tidak bisa mendapatkan objek cache dari container" + +#: Console/Command/ApplicationChecker/CacheChecker.php:43 +msgctxt "console" +msgid "Cache is not valid object from container" +msgstr "Objek cache tidak valid dari container" + +#: Console/Command/ApplicationChecker/CacheChecker.php:52 +msgctxt "console" +msgid "Cache object error" +msgstr "Objek cache bermasalah" + +#: Console/Command/ApplicationChecker/CacheChecker.php:58 +#: Console/Command/ApplicationChecker/CacheChecker.php:94 +#: Console/Command/DatabaseChecker.php:1588 +msgctxt "console" +msgid "Error:" +msgstr "Kesalahan:" + +#: Console/Command/ApplicationChecker/CacheChecker.php:61 +#: Console/Command/ApplicationChecker/CacheChecker.php:97 +msgctxt "console" +msgid "Unknown Error" +msgstr "Kesalahan yang tidak diketahui" + +#: Console/Command/ApplicationChecker/CacheChecker.php:74 +#, php-format +msgctxt "console" +msgid "Cache object is set [%s]" +msgstr "Objek cache telah ditentukan [%s]" + +#: Console/Command/ApplicationChecker/CacheChecker.php:111 +msgctxt "console" +msgid "Adapter" +msgstr "Adaptor" + +#: Console/Command/ApplicationChecker/CacheChecker.php:120 +msgctxt "console" +msgid "Default Lifetime" +msgstr "Lifetime Bawaan" + +#: Console/Command/ApplicationChecker/CacheChecker.php:136 +msgctxt "console" +msgid "Namespace" +msgstr "Namespace" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:61 +msgctxt "console" +msgid "Config environment is not set" +msgstr "Environmen konfig belum ditentukan" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:71 +#, php-format +msgctxt "console" +msgid "Debugging - error display [%s]" +msgstr "Debugging - tampilan kesalahan [%s]" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:73 +#: Console/Command/ApplicationChecker/ConfigChecker.php:84 +#: Console/Command/ApplicationChecker/ConfigChecker.php:95 +msgctxt "console" +msgid "Enabled" +msgstr "Diaktifkan" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:74 +#: Console/Command/ApplicationChecker/ConfigChecker.php:85 +#: Console/Command/ApplicationChecker/ConfigChecker.php:96 +msgctxt "console" +msgid "Disabled" +msgstr "Dinonaktifkan" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:82 +#, php-format +msgctxt "console" +msgid "Benchmark debug bar [%s]" +msgstr "Benchmark debug bar [%s]" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:93 +#, php-format +msgctxt "console" +msgid "Benchmark profiling [%s]" +msgstr "Profiling benchmark [%s]" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:119 +#, php-format +msgctxt "console" +msgid "Benchmarks records (%d)" +msgstr "Rekaman benchmark (%d)" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:129 +msgctxt "console" +msgid "Benchmarks group" +msgstr "Grup benchmark" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:190 +msgctxt "console" +msgid "App directory is not exists" +msgstr "Direktori App tidak ada" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:196 +msgctxt "console" +msgid "Required Applications directory" +msgstr "Direktori Aplikasi yang diperlukan" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:208 +msgctxt "console" +msgid "Storage directory is not writable" +msgstr "Direktori penyimpanan tidak dapat ditulisi" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:223 +msgctxt "console" +msgid "directory" +msgstr "direktori" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:250 +#, php-format +msgctxt "console" +msgid "Configuration file is not a valid file (%s)" +msgstr "Berkas konfigurasi bukan berkas yang sah (%s)" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:254 +#, php-format +msgctxt "console" +msgid "Configuration file is invalid (%s)" +msgstr "Berkas konfigurasi tidak sah (%s)" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:258 +#, php-format +msgctxt "console" +msgid "Configuration file is empty (%s)" +msgstr "Berkas konfigurasi kosong (%s)" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:262 +#, php-format +msgctxt "console" +msgid "Configuration file does not exists (%s)" +msgstr "Berkas konfigurasi tidak tersedia (%s)" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:274 +#: Console/Command/ApplicationChecker/ConfigChecker.php:354 +msgctxt "console" +msgid "Configuration" +msgstr "Konfigurasi" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:286 +msgctxt "console" +msgid "Configuration file is not exists on container" +msgstr "Berkas konfigurasi tidak tersedia di container" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:296 +msgctxt "console" +msgid "Configuration file does not contain database configuration" +msgstr "Berkas konfigurasi tidak berisi konfigurasi basis data" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:313 +msgctxt "console" +msgid "Configuration file does not contain valid database configuration" +msgstr "Berkas konfigurasi tidak berisi konfigurasi basis data yang sah" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:325 +msgctxt "console" +msgid "Configuration file does not contain security configuration" +msgstr "Berkas konfigurasi tidak terdapat konfigurasi keamanan" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:336 +msgctxt "console" +msgid "Configuration file does not contain valid security configuration" +msgstr "Berkas konfigurasi tidak berisi konfigurasi keamanan yang sah" + +#: Console/Command/ApplicationChecker/ConfigChecker.php:346 +msgctxt "console" +msgid "Configuration file is exist & valid" +msgstr "Berkas konfigurasi tersedia & sah" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:23 +msgctxt "console" +msgid "Container object not set" +msgstr "Object Container belum ditentukan" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:30 +#, php-format +msgctxt "console" +msgid "Container object is set [%s]" +msgstr "Objek Container telah ditentukan [%s]" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:46 +#, php-format +msgctxt "console" +msgid "Registered Container (%d)" +msgstr "Container Terdaftar (%d)" + +#: Console/Command/ApplicationChecker/ContainerChecker.php:67 +#, php-format +msgctxt "console" +msgid "Registered Aliases (%d)" +msgstr "Alias ​​Terdaftar (%d)" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:37 +msgctxt "console" +msgid "Php version" +msgstr "Versi Php" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:63 +msgctxt "console" +msgid "extension is not exist" +msgstr "ekstensi tidak tersedia" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:74 +msgctxt "console" +msgid "extension valid" +msgstr "ekstensi sah" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:78 +msgctxt "console" +msgid "with version" +msgstr "dengan versi" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:87 +msgctxt "console" +msgid "All required extensions are installed" +msgstr "Semua ekstensi yang diperlukan telah terpasang" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:98 +msgctxt "console" +msgid "required extensions is not installed" +msgstr "ekstensi yang diperlukan belum terpasang" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:143 +msgctxt "console" +msgid "extension installed" +msgstr "ekstensi terinstall" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:151 +msgctxt "console" +msgid "No recommended extensions installed" +msgstr "Tidak ada rekomendasi ekstensi yang terpasang" + +#: Console/Command/ApplicationChecker/DependencyChecker.php:162 +msgctxt "console" +msgid "recommended extension installed" +msgid_plural "recommended extensions installed" +msgstr[0] "rekomendasi ekstensi yang terpasang" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:25 +msgctxt "console" +msgid "Can not get translator object from container" +msgstr "Tidak bisa mendapatkan objek penerjemah dari container" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:40 +msgctxt "console" +msgid "Translator is not valid object from container" +msgstr "Penerjemah tidak valid dari container" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:51 +msgctxt "console" +msgid "Translator object is set" +msgstr "Object penerjemah tidak ditentukan" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:61 +msgctxt "console" +msgid "No Adapter Registered" +msgstr "Tidak Ada Adaptor Terdaftar" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:66 +#, php-format +msgctxt "console" +msgid "Registered Adapters (%d)" +msgstr "Adaptor Terdaftar (%d)" + +#: Console/Command/ApplicationChecker/TranslatorChecker.php:90 +msgctxt "console" +msgid "Current Language" +msgstr "Bahasa Saat Ini" + +#: Console/Command/BuiltInWebServer.php:90 +msgctxt "console" +msgid "Create temporary php builtin web server." +msgstr "Buat server web sementara bawaan php." + +#: Console/Command/BuiltInWebServer.php:99 +msgctxt "console" +msgid "Port number that used for listening server" +msgstr "Nomor port yang digunakan untuk server" + +#: Console/Command/BuiltInWebServer.php:109 +msgctxt "console" +msgid "Host that used to listening server." +msgstr "Host yang digunakan untuk server." + +#: Console/Command/BuiltInWebServer.php:123 +msgctxt "console" +msgid "Public index.php file." +msgstr "Berkas public index.php." + +#: Console/Command/BuiltInWebServer.php:128 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create temporary php builtin web server like:\n" +"\n" +" %s\n" +"\n" +"You can use %s\n" +"\n" +"Host accept local %s\n" +"Port accept range between %s" +msgstr "" +"%s Membantu anda untuk membuat php builtin web server sementara seperti:\n" +"\n" +" %s\n" +"\n" +"Anda dapat menggunakan %s\n" +"\n" +"Menerima host local %s\n" +"Menerima port antara %s" + +#: Console/Command/BuiltInWebServer.php:139 +msgctxt "console" +msgid "port number" +msgstr "nomor port" + +#: Console/Command/BuiltInWebServer.php:143 +#: Console/Command/BuiltInWebServer.php:147 +msgctxt "console" +msgid "default" +msgstr "default" + +#: Console/Command/BuiltInWebServer.php:170 +#: Console/Command/BuiltInWebServer.php:188 +#: Console/Command/BuiltInWebServer.php:223 +#: Console/Command/BuiltInWebServer.php:256 +#: Console/Command/BuiltInWebServer.php:273 +#: Console/Command/BuiltInWebServer.php:340 +#: Console/Command/BuiltInWebServer.php:357 +#: Console/Command/BuiltInWebServer.php:374 +#: Console/Command/BuiltInWebServer.php:391 +#: Console/Command/BuiltInWebServer.php:457 +#: Console/Command/BuiltInWebServer.php:558 +#, php-format +msgctxt "console" +msgid "Command %s Error!" +msgstr "Perintah %s Bermasalah!" + +#: Console/Command/BuiltInWebServer.php:176 +msgctxt "console" +msgid "Port is Invalid! option port must be numeric." +msgstr "Port Tidak Sah! opsi port harus berupa angka." + +#: Console/Command/BuiltInWebServer.php:195 +#, php-format +msgctxt "console" +msgid "Port is Invalid! option port should not use: %s" +msgstr "Port Tidak Sah! opsi port tidak boleh menggunakan: %s" + +#: Console/Command/BuiltInWebServer.php:207 +#, php-format +msgctxt "console" +msgid "Typically this port used by %s application." +msgstr "Biasanya port ini digunakan oleh aplikasi %s." + +#: Console/Command/BuiltInWebServer.php:230 +#, php-format +msgctxt "console" +msgid "Port is out of range! option port must be between: %s to %s" +msgstr "Port berada di luar jangkauan! opsi port harus antara: %s hingga %s" + +#: Console/Command/BuiltInWebServer.php:262 +msgctxt "console" +msgid "" +"Option host is invalid. Host only accept \"localhost\" and local IP address." +msgstr "" +"Opsi host tidak sah. Host hanya menerima “localhost” dan alamat IP lokal." + +#: Console/Command/BuiltInWebServer.php:280 +#, php-format +msgctxt "console" +msgid "Option host is invalid. IP %s is not a local IP address." +msgstr "Opsi host tidak sah. IP %s bukan merupakan alamat IP lokal." + +#: Console/Command/BuiltInWebServer.php:346 +msgctxt "console" +msgid "Could not detect public root file." +msgstr "Tidak dapat mendeteksi berkas root publik." + +#: Console/Command/BuiltInWebServer.php:363 +msgctxt "console" +msgid "Public root file is not in application directory!" +msgstr "Berkas root publik tidak berada pada direktori aplikasi!" + +#: Console/Command/BuiltInWebServer.php:380 +msgctxt "console" +msgid "Could not detect php binary executable file." +msgstr "Tidak dapat mendeteksi berkas binary executable php." + +#: Console/Command/BuiltInWebServer.php:396 +msgctxt "console" +msgid "Function [exec] is not exist" +msgstr "Fungsi [exec] tidak tersedia" + +#: Console/Command/BuiltInWebServer.php:421 +msgctxt "console" +msgid "Checking" +msgstr "Memeriksa" + +#: Console/Command/BuiltInWebServer.php:429 +msgctxt "console" +msgid "Port" +msgstr "Port" + +#: Console/Command/BuiltInWebServer.php:466 +#, php-format +msgctxt "console" +msgid "Can not determine port that can be used after doing %s tests" +msgstr "" +"Tidak dapat menentukan port yang dapat digunakan setelah melakukan %s tes" + +#: Console/Command/BuiltInWebServer.php:475 +#, php-format +msgctxt "console" +msgid "Can not listening %s with port %s" +msgstr "Tidak dapat memproses %s dengan port %s" + +#: Console/Command/BuiltInWebServer.php:531 +#, php-format +msgctxt "console" +msgid "Press %s to exit." +msgstr "Tekan %s untuk keluar." + +#: Console/Command/ChecksumGenerator.php:59 +msgctxt "console" +msgid "Create list of core file checksums." +msgstr "Membuat berkas daftar inti ceksum." + +#: Console/Command/ChecksumGenerator.php:68 +msgctxt "console" +msgid "Display checksums on terminal without writing to disk" +msgstr "Tampilkan checksum di terminal tanpa menulis ke disk" + +#: Console/Command/ChecksumGenerator.php:78 +#, php-format +msgctxt "console" +msgid "The %s creating checksum files on %s directory." +msgstr "%s membuat berkas ceksum pada direktori %s." + +#: Console/Command/ChecksumGenerator.php:121 +#, php-format +msgctxt "console" +msgid "Files will be put in directory: %s" +msgstr "Berkas akan diletakkan pada direktori: %s" + +#: Console/Command/ChecksumGenerator.php:133 +#: Console/Command/CommandGenerator.php:329 +#: Console/Command/ControllerGenerator.php:292 +#: Console/Command/DatabaseChecker.php:1255 +#: Console/Command/DatabaseChecker.php:1397 +#: Console/Command/DatabaseEventGenerator.php:329 +#: Console/Command/EntityGenerator.php:325 +#: Console/Command/MiddlewareGenerator.php:311 +#: Console/Command/ModuleGenerator.php:344 +#: Console/Command/SchedulerGenerator.php:349 +msgctxt "console" +msgid "Are you sure to continue (Yes/No)?" +msgstr "Apakah anda yakin ingin melanjutkan (Yes/No)?" + +#: Console/Command/ChecksumGenerator.php:148 +#: Console/Command/CommandGenerator.php:342 +#: Console/Command/ControllerGenerator.php:305 +#: Console/Command/DatabaseChecker.php:1270 +#: Console/Command/DatabaseChecker.php:1412 +#: Console/Command/DatabaseEventGenerator.php:342 +#: Console/Command/EntityGenerator.php:338 +#: Console/Command/MiddlewareGenerator.php:326 +#: Console/Command/ModuleGenerator.php:359 +#: Console/Command/SchedulerGenerator.php:362 +msgctxt "console" +msgid "Please enter valid answer! (Yes / No)" +msgstr "Mohon masukkan jawaban yang benar! (Yes/No)" + +#: Console/Command/ChecksumGenerator.php:160 +#: Console/Command/CommandGenerator.php:386 +#: Console/Command/ControllerGenerator.php:347 +#: Console/Command/DatabaseChecker.php:1282 +#: Console/Command/DatabaseChecker.php:1426 +#: Console/Command/DatabaseEventGenerator.php:386 +#: Console/Command/EntityGenerator.php:383 +#: Console/Command/MiddlewareGenerator.php:370 +#: Console/Command/ModuleGenerator.php:403 +#: Console/Command/SchedulerGenerator.php:408 +msgctxt "console" +msgid "Operation cancelled!" +msgstr "Operasi dibatalkan!" + +#: Console/Command/ChecksumGenerator.php:271 +msgctxt "console" +msgid "Done!" +msgstr "Selesai!" + +#: Console/Command/ChecksumGenerator.php:283 +msgctxt "console" +msgid "Source" +msgstr "Sumber" + +#: Console/Command/CommandGenerator.php:79 +msgctxt "console" +msgid "Generate command class." +msgstr "Hasilkan kelas perintah." + +#: Console/Command/CommandGenerator.php:85 +#: Console/Command/ControllerGenerator.php:88 +#: Console/Command/DatabaseEventGenerator.php:89 +#: Console/Command/EntityGenerator.php:85 +#: Console/Command/MiddlewareGenerator.php:85 +#: Console/Command/ModuleGenerator.php:85 +#: Console/Command/SchedulerGenerator.php:85 +msgctxt "console" +msgid "Print generated class file only" +msgstr "Tampilkan berkas kelas yang dihasilkan saja" + +#: Console/Command/CommandGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Command will use prefix namespace with %s\n" +"Command only support single class name.\n" +msgstr "" +"%s membantu Anda membuat objek %s.\n" +"\n" +"Perintah akan menggunakan awalan namespace dengan %s\n" +"Perintah hanya mendukung nama kelas tunggal.\n" + +#: Console/Command/CommandGenerator.php:174 +msgctxt "console" +msgid "Please enter command class name" +msgstr "Mohon masukkan nama kelas perintah" + +#: Console/Command/CommandGenerator.php:181 +msgctxt "console" +msgid "Please enter valid command class name!" +msgstr "Mohon masukkan nama kelas perintah yang sah!" + +#: Console/Command/CommandGenerator.php:192 +#, php-format +msgctxt "console" +msgid "Command [%s] is invalid! class name contain reserved keyword!" +msgstr "Perintah [%s] tidak sah! nama kelas berisi kata kunci bawaan!" + +#: Console/Command/CommandGenerator.php:203 +#, php-format +msgctxt "console" +msgid "" +"Command [%s] is invalid! Command only contain single class name, not " +"namespaced!" +msgstr "" +"Perintah [%s] tidak sah! Perintah hanya boleh berupa nama kelas tunggal, " +"bukan berupa namsapace!" + +#: Console/Command/CommandGenerator.php:214 +#, php-format +msgctxt "console" +msgid "Command [%s] is too long! Must be less or equal 128 characters" +msgstr "" +"Perintah [%s] terlalu panjang! Harus kurang dari atau sama dengan 128 " +"karakter" + +#: Console/Command/CommandGenerator.php:224 +#, php-format +msgctxt "console" +msgid "Command [%s] exist" +msgstr "Perintah [%s] tersedia" + +#: Console/Command/CommandGenerator.php:254 +#, php-format +msgctxt "console" +msgid "%s Could not detect command directory" +msgstr "%s Tidak dapat mendeteksi direktori perintah" + +#: Console/Command/CommandGenerator.php:268 +#: Console/Command/ControllerGenerator.php:238 +#: Console/Command/DatabaseEventGenerator.php:269 +#: Console/Command/EntityGenerator.php:253 +#: Console/Command/MiddlewareGenerator.php:250 +#: Console/Command/ModuleGenerator.php:268 +#: Console/Command/SchedulerGenerator.php:272 +#, php-format +msgctxt "console" +msgid "%s generator only support in interactive mode" +msgstr "Generator %s hanya mendukung mode interaktif" + +#: Console/Command/CommandGenerator.php:292 +#, php-format +msgctxt "console" +msgid "Command Name : %s" +msgstr "Nama Perintah : %s" + +#: Console/Command/CommandGenerator.php:305 +#, php-format +msgctxt "console" +msgid "Command Class : %s" +msgstr "Kelas Perintah : %s" + +#: Console/Command/CommandGenerator.php:317 +#, php-format +msgctxt "console" +msgid "Command File : %s" +msgstr "Berkas Perintah : %s" + +#: Console/Command/CommandGenerator.php:364 +#, php-format +msgctxt "console" +msgid "%s Could not save command!" +msgstr "%s Tidak dapat menyimpan perintah!" + +#: Console/Command/CommandGenerator.php:375 +#, php-format +msgctxt "console" +msgid "%s Command successfully created!" +msgstr "%s Perintah berhasil dibuat!" + +#: Console/Command/ControllerGenerator.php:80 +msgctxt "console" +msgid "Generate controller class." +msgstr "Hasilkan kelas pengontrol." + +#: Console/Command/ControllerGenerator.php:94 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create controller object.\n" +"Controller will use prefix namespace with %s\n" +"Character slash %s, hyphen %s and underscore %s\n" +"Will converted into namespace separator" +msgstr "" +"%s membantu Anda membuat objek pengontrol.\n" +"Pengontrol akan menggunakan awalan namespace dengan %s\n" +"Karakter garis miring %s, tanda hubung %s dan garis bawah %s\n" +"Akan diubah menjadi pemisah namespace" + +#: Console/Command/ControllerGenerator.php:160 +msgctxt "console" +msgid "Please enter controller name" +msgstr "Mohon masukkan nama pengontrol" + +#: Console/Command/ControllerGenerator.php:166 +msgctxt "console" +msgid "Please enter valid controller name!" +msgstr "Silakan masukkan nama pengontrol yang sah!" + +#: Console/Command/ControllerGenerator.php:173 +#, php-format +msgctxt "console" +msgid "Controller [%s] is too long! Must be less or equal 5 namespaces" +msgstr "" +"Pengontrol [%s] terlalu panjang! Harus kurang dari atau sama dengan 5 " +"namespace" + +#: Console/Command/ControllerGenerator.php:184 +#, php-format +msgctxt "console" +msgid "Controller [%s] is invalid! class name contain reserved keyword!" +msgstr "Pengontrol [%s] tidak sah! nama kelas berisi kata kunci bawaan!" + +#: Console/Command/ControllerGenerator.php:194 +#, php-format +msgctxt "console" +msgid "Controller [%s] exist" +msgstr "Pengontrol [%s] tersedia" + +#: Console/Command/ControllerGenerator.php:224 +#, php-format +msgctxt "console" +msgid "%s Could not detect controller directory" +msgstr "%s Tidak dapat mendeteksi direktori pengontrol" + +#: Console/Command/ControllerGenerator.php:260 +#, php-format +msgctxt "console" +msgid "Controller Name : %s" +msgstr "Nama Pengontrol : %s" + +#: Console/Command/ControllerGenerator.php:271 +#, php-format +msgctxt "console" +msgid "Controller Class : %s" +msgstr "Kelas Pengontrol : %s" + +#: Console/Command/ControllerGenerator.php:282 +#, php-format +msgctxt "console" +msgid "Controller File : %s" +msgstr "Berkas Pengontrol : %s" + +#: Console/Command/ControllerGenerator.php:325 +#, php-format +msgctxt "console" +msgid "%s Could not save controller!" +msgstr "%s Tidak dapat menyimpan pengontrol!" + +#: Console/Command/ControllerGenerator.php:336 +#, php-format +msgctxt "console" +msgid "%s Controller successfully created!" +msgstr "%s Pengontrol berhasil dibuat!" + +#: Console/Command/DatabaseChecker.php:85 +msgctxt "console" +msgid "Check & validate database." +msgstr "Periksa & validasi basis data." + +#: Console/Command/DatabaseChecker.php:93 +msgctxt "console" +msgid "Validate changed / difference about database schema" +msgstr "Validasi perubahan / perbedaan tentang skema basis data" + +#: Console/Command/DatabaseChecker.php:104 +#, php-format +msgctxt "console" +msgid "Print sql query create schema (should execute with %s command)" +msgstr "" +"Tampilkan kueri sql untuk pembuatan skema (seharusnya dijalankan dengan " +"perintah %s)" + +#: Console/Command/DatabaseChecker.php:120 +#, php-format +msgctxt "console" +msgid "Dump create schema (should execute with %s & %s command)" +msgstr "Dump skema pembuatan (seharusnya dijalankan dengan perintah %s & %s)" + +#: Console/Command/DatabaseChecker.php:140 +#, php-format +msgctxt "console" +msgid "" +"Execute query sql that from new schema into database (should execute with %s " +"command)" +msgstr "" +"Jalankan kueri sql yang dari skema baru ke dalam basis data (seharusnya " +"dijalankan dengan perintah %s)" + +#: Console/Command/DatabaseChecker.php:156 +#, php-format +msgctxt "console" +msgid "Optimize database when possible (should execute with %s command)" +msgstr "" +"Optimalkan basis data apabila memungkinkan (harus dijalankan dengan perintah " +"%s)" + +#: Console/Command/DatabaseChecker.php:170 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to validate database.\n" +"This command show information about installed database & configuration " +"services." +msgstr "" +"%s membantu Anda memvalidasi database.\n" +"Perintah ini menampilkan informasi tentang database yang terinstall & " +"layanan konfigurasi." + +#: Console/Command/DatabaseChecker.php:248 +#: Console/Command/DatabaseChecker.php:1545 +msgctxt "console" +msgid "Can not get database object from container" +msgstr "Tidak bisa mendapatkan objek basis data dari container" + +#: Console/Command/DatabaseChecker.php:259 +#: Console/Command/DatabaseChecker.php:1557 +msgctxt "console" +msgid "Database connection is not valid object from container" +msgstr "Koneksi basis data bukan objek yang valid dari container" + +#: Console/Command/DatabaseChecker.php:364 +msgctxt "console" +msgid "No schema can be created" +msgstr "Tidak ada skema yang bisa dibuat" + +#: Console/Command/DatabaseChecker.php:396 +#: Console/Command/DatabaseChecker.php:1360 +#: Console/Command/DatabaseChecker.php:1371 +msgctxt "console" +msgid "No change into database schema" +msgstr "Tidak ada perubahan pada skema basis data" + +#: Console/Command/DatabaseChecker.php:426 +#: Console/Command/DatabaseChecker.php:439 +#, php-format +msgctxt "console" +msgid "Table \"%s\" does not exist!" +msgstr "Tabel \"%s\" tidak ada!" + +#: Console/Command/DatabaseChecker.php:464 +#, php-format +msgctxt "console" +msgid "Table \"%s\" %s" +msgstr "Tabel \"%s\" %s" + +#: Console/Command/DatabaseChecker.php:475 +msgctxt "console" +msgid "no difference" +msgstr "tak ada perbedaan" + +#: Console/Command/DatabaseChecker.php:480 +#: Console/Command/DatabaseChecker.php:505 +#: Console/Command/DatabaseChecker.php:1918 +msgctxt "console" +msgid "NEED TO OPTIMIZE" +msgstr "PERLU OPTIMASI" + +#: Console/Command/DatabaseChecker.php:497 +#, php-format +msgctxt "console" +msgid "Table \"%s\" need to be change" +msgstr "Tabel \"%s\" butuh diubah" + +#: Console/Command/DatabaseChecker.php:534 +#: Console/Command/DatabaseChecker.php:556 +#: Console/Command/DatabaseChecker.php:578 +#: Console/Command/DatabaseChecker.php:600 +#: Console/Command/DatabaseChecker.php:622 +#: Console/Command/DatabaseChecker.php:644 +#: Console/Command/DatabaseChecker.php:666 +#: Console/Command/DatabaseChecker.php:688 +#: Console/Command/DatabaseChecker.php:713 +#: Console/Command/DatabaseChecker.php:735 +msgctxt "console" +msgid "Column" +msgstr "Kolom" + +#: Console/Command/DatabaseChecker.php:536 +msgctxt "console" +msgid "type" +msgstr "tipe" + +#: Console/Command/DatabaseChecker.php:538 +#: Console/Command/DatabaseChecker.php:560 +#: Console/Command/DatabaseChecker.php:582 +#: Console/Command/DatabaseChecker.php:604 +#: Console/Command/DatabaseChecker.php:626 +#: Console/Command/DatabaseChecker.php:648 +#: Console/Command/DatabaseChecker.php:670 +#: Console/Command/DatabaseChecker.php:693 +#: Console/Command/DatabaseChecker.php:717 +#: Console/Command/DatabaseChecker.php:739 +#, php-format +msgctxt "console" +msgid "change from: [%s] to [%s]" +msgstr "ubah dari: [%s] ke [%s]" + +#: Console/Command/DatabaseChecker.php:558 +msgctxt "console" +msgid "default value" +msgstr "nilai bawaan" + +#: Console/Command/DatabaseChecker.php:690 +msgctxt "console" +msgid "scale" +msgstr "skala" + +#: Console/Command/DatabaseChecker.php:737 +msgctxt "console" +msgid "comment" +msgstr "komentar" + +#: Console/Command/DatabaseChecker.php:760 +msgctxt "console" +msgid "Added Column" +msgstr "Kolom Ditambahkan" + +#: Console/Command/DatabaseChecker.php:771 +msgctxt "console" +msgid "Removed Column" +msgstr "Kolom Yang Dihapus" + +#: Console/Command/DatabaseChecker.php:782 +msgctxt "console" +msgid "Renamed Column" +msgstr "Kolom Berganti Nama" + +#: Console/Command/DatabaseChecker.php:784 +#, php-format +msgctxt "console" +msgid "from [%s] to [%s]" +msgstr "dari [%s] ke [%s]" + +#: Console/Command/DatabaseChecker.php:807 +msgctxt "console" +msgid "Modify Index" +msgstr "Modifikasi Index" + +#: Console/Command/DatabaseChecker.php:809 +#, php-format +msgctxt "console" +msgid "from %s to %s" +msgstr "dari %s ke %s" + +#: Console/Command/DatabaseChecker.php:842 +msgctxt "console" +msgid "Added Index" +msgstr "Penambahan Index" + +#: Console/Command/DatabaseChecker.php:860 +msgctxt "console" +msgid "Removed Index" +msgstr "Penghapusan Index" + +#: Console/Command/DatabaseChecker.php:880 +msgctxt "console" +msgid "Renamed Index" +msgstr "Perubahan Nama Index" + +#: Console/Command/DatabaseChecker.php:901 +msgctxt "console" +msgid "Modify ForeignKey" +msgstr "Modifikasi ForeignKey" + +#: Console/Command/DatabaseChecker.php:947 +msgctxt "console" +msgid "Added ForeignKey" +msgstr "Penambahan ForeignKey" + +#: Console/Command/DatabaseChecker.php:969 +msgctxt "console" +msgid "Removed ForeignKey" +msgstr "Hapus ForeignKey" + +#: Console/Command/DatabaseChecker.php:1006 +#: Console/Command/DatabaseChecker.php:1039 +#: Console/Command/DatabaseChecker.php:1073 +#, php-format +msgctxt "console" +msgid "Table \"%s\" for %s & does not exist in schema" +msgstr "Tabel \"%s\" untuk %s & tidak ada di skema" + +#: Console/Command/DatabaseChecker.php:1101 +#, php-format +msgctxt "console" +msgid "Table \"%s\" for %s" +msgstr "Tabel \"%s\" untuk %s" + +#: Console/Command/DatabaseChecker.php:1148 +msgctxt "console" +msgid "Contains changed database schema, you can execute command :" +msgstr "Berisi skema database yang diubah, anda dapat menjalankan perintah:" + +#: Console/Command/DatabaseChecker.php:1173 +#: Console/Command/DatabaseChecker.php:1971 +msgctxt "console" +msgid "" +"Contains database table that can be optimized, you can execute command :" +msgstr "" +"Berisi tabel database yang dapat dioptimasi, anda dapat menjalankan " +"perintah :" + +#: Console/Command/DatabaseChecker.php:1201 +msgctxt "console" +msgid "There are no tables that can be optimized" +msgstr "Tidak ada tabel yang dapat dioptimalkan" + +#: Console/Command/DatabaseChecker.php:1216 +#, php-format +msgctxt "console" +msgid "%s does not yet support optimization" +msgstr "%s belum mendukung pengoptimalan" + +#: Console/Command/DatabaseChecker.php:1237 +#, php-format +msgctxt "console" +msgid "Table \"%s\" can be freed up to : (%s)" +msgstr "Tabel \"%s\" dapat dikosongkan hingga : (%s)" + +#: Console/Command/DatabaseChecker.php:1291 +#: Console/Command/DatabaseChecker.php:1439 +msgctxt "console" +msgid "PLEASE DO NOT CANCEL OPERATION!" +msgstr "MOHON JANGAN MEMBATALKAN OPERASI!" + +#: Console/Command/DatabaseChecker.php:1299 +msgctxt "console" +msgid "Optimizing table" +msgstr "Mengoptimasi tabel" + +#: Console/Command/DatabaseChecker.php:1328 +msgctxt "console" +msgid "FAIL" +msgstr "GAGAL" + +#: Console/Command/DatabaseChecker.php:1338 +#: Console/Command/DatabaseChecker.php:1527 +msgctxt "console" +msgid "ALL DONE!" +msgstr "SEMUA SELESAI!" + +#: Console/Command/DatabaseChecker.php:1381 +msgctxt "console" +msgid "Executed Command:" +msgstr "Perintah Tereksekusi:" + +#: Console/Command/DatabaseChecker.php:1465 +msgctxt "console" +msgid "Executing:" +msgstr "Mengeksekusi:" + +#: Console/Command/DatabaseChecker.php:1483 +#: Console/Command/DatabaseChecker.php:1512 +msgctxt "console" +msgid "Failed to execute command" +msgstr "Gagal dalam mengeksekusi perintah" + +#: Console/Command/DatabaseChecker.php:1582 +msgctxt "console" +msgid "Database connection error." +msgstr "Koneksi basis data bermasalah." + +#: Console/Command/DatabaseChecker.php:1600 +msgctxt "console" +msgid "Database connection succeed" +msgstr "Koneksi basis data berhasil" + +#: Console/Command/DatabaseChecker.php:1638 +msgctxt "console" +msgid "Database name" +msgstr "Nama basis data" + +#: Console/Command/DatabaseChecker.php:1655 +msgctxt "console" +msgid "Database host" +msgstr "Host basis data" + +#: Console/Command/DatabaseChecker.php:1664 +msgctxt "console" +msgid "Database user" +msgstr "Pengguna basis data" + +#: Console/Command/DatabaseChecker.php:1673 +msgctxt "console" +msgid "Database password" +msgstr "Kata sandi basis data" + +#: Console/Command/DatabaseChecker.php:1695 +msgctxt "console" +msgid "Unknown" +msgstr "Tidak diketahui" + +#: Console/Command/DatabaseChecker.php:1704 +msgctxt "console" +msgid "Connection Object Info" +msgstr "Info Objek Koneksi" + +#: Console/Command/DatabaseChecker.php:1712 +msgctxt "console" +msgid "Connection" +msgstr "Koneksi" + +#: Console/Command/DatabaseChecker.php:1766 +msgctxt "console" +msgid "ORM Configuration" +msgstr "Konfigurasi ORM" + +#: Console/Command/DatabaseChecker.php:1772 +msgctxt "console" +msgid "Query Cache" +msgstr "Cache Kueri" + +#: Console/Command/DatabaseChecker.php:1773 +msgctxt "console" +msgid "Result Cache" +msgstr "Cache Hasil" + +#: Console/Command/DatabaseChecker.php:1774 +msgctxt "console" +msgid "Proxy Namespace" +msgstr "Namespace Proksi" + +#: Console/Command/DatabaseChecker.php:1775 +msgctxt "console" +msgid "Proxy Directory" +msgstr "Direktori Proksi" + +#: Console/Command/DatabaseChecker.php:1776 +msgctxt "console" +msgid "Metadata Driver" +msgstr "Driver Metadata" + +#: Console/Command/DatabaseChecker.php:1777 +msgctxt "console" +msgid "Repository Factory" +msgstr "Factory Repositori" + +#: Console/Command/DatabaseChecker.php:1778 +msgctxt "console" +msgid "Quote Strategy" +msgstr "Strategi Quote" + +#: Console/Command/DatabaseChecker.php:1779 +msgctxt "console" +msgid "Naming Factory" +msgstr "Factory Penamaan" + +#: Console/Command/DatabaseChecker.php:1780 +msgctxt "console" +msgid "Schema Manager Factory" +msgstr "Factory Manajer Skema" + +#: Console/Command/DatabaseChecker.php:1789 +msgctxt "console" +msgid "Not Set" +msgstr "Tidak Diatur" + +#: Console/Command/DatabaseChecker.php:1799 +msgctxt "console" +msgid "Registered Schema / Entities" +msgstr "Skema / Entitas Yang Terdaftar" + +#: Console/Command/DatabaseChecker.php:1932 +msgctxt "console" +msgid "Changing" +msgstr "Merubah" + +#: Console/Command/DatabaseChecker.php:1946 +msgctxt "console" +msgid "Contains changed database schema, you can check with command :" +msgstr "" +"Berisi skema database yang diubah, anda dapat memeriksanya dengan perintah :" + +#: Console/Command/DatabaseEventGenerator.php:83 +msgctxt "console" +msgid "Generate database event class." +msgstr "Hasilkan kelas event basis data." + +#: Console/Command/DatabaseEventGenerator.php:94 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Database Event will use prefix namespace with %s\n" +"Database Event only support single class name." +msgstr "" +"%s membantu Anda membuat objek %s.\n" +"\n" +"Peristiwa Basis Data akan menggunakan awalan namespace dengan %s\n" +"Basis Data Event hanya mendukung satu nama kelas." + +#: Console/Command/DatabaseEventGenerator.php:178 +msgctxt "console" +msgid "Please enter database event class name" +msgstr "Silakan masukkan nama kelas basis data event" + +#: Console/Command/DatabaseEventGenerator.php:184 +msgctxt "console" +msgid "Please enter valid database event class name!" +msgstr "Silakan masukkan nama kelas basis data event yang sah!" + +#: Console/Command/DatabaseEventGenerator.php:193 +#, php-format +msgctxt "console" +msgid "Event [%s] is invalid! class name contain reserved keyword!" +msgstr "Acara [%s] tidak valid! nama kelas berisi kata kunci bawaan!" + +#: Console/Command/DatabaseEventGenerator.php:204 +#, php-format +msgctxt "console" +msgid "" +"Event [%s] is invalid! Database event only contain single class name, not " +"namespaced!" +msgstr "" +"Event [%s] tidak sah! Basis data event hanya boleh berupa nama kelas " +"tunggal, bukan bermuatan namespace!" + +#: Console/Command/DatabaseEventGenerator.php:215 +#, php-format +msgctxt "console" +msgid "Database event [%s] is too long! Must be less or equal 128 characters" +msgstr "" +"Event basis data [%s] terlalu panjang! Harus kurang dari atau sama dengan " +"128 karakter" + +#: Console/Command/DatabaseEventGenerator.php:225 +#, php-format +msgctxt "console" +msgid "Database event [%s] exist" +msgstr "Database event [%s] tersedia" + +#: Console/Command/DatabaseEventGenerator.php:255 +#, php-format +msgctxt "console" +msgid "%s Could not detect database event directory" +msgstr "%s Tidak dapat mendeteksi direktori basis data acara" + +#: Console/Command/DatabaseEventGenerator.php:292 +#, php-format +msgctxt "console" +msgid "Database Event Name : %s" +msgstr "Nama Event Basis Data: %s" + +#: Console/Command/DatabaseEventGenerator.php:305 +#, php-format +msgctxt "console" +msgid "DatabaseEvent Class : %s" +msgstr "Kelas DatabaseEvent : %s" + +#: Console/Command/DatabaseEventGenerator.php:317 +#, php-format +msgctxt "console" +msgid "DatabaseEvent File : %s" +msgstr "Berkas DatabaseEvent : %s" + +#: Console/Command/DatabaseEventGenerator.php:364 +#, php-format +msgctxt "console" +msgid "%s Could not save databaseEvent!" +msgstr "%s Tidak dapat menyimpan databaseEvent!" + +#: Console/Command/DatabaseEventGenerator.php:375 +#, php-format +msgctxt "console" +msgid "%s DatabaseEvent successfully created!" +msgstr "%s DatabaseEvent berhasil dibuat!" + +#: Console/Command/EntityGenerator.php:79 +msgctxt "console" +msgid "Generate entity class." +msgstr "Hasilkan kelas entitas." + +#: Console/Command/EntityGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Entity will use prefix namespace with %s\n" +msgstr "" +"%s membantu Anda membuat objek %s.\n" +"\n" +"Entitas akan menggunakan awalan namespace dengan %s\n" + +#: Console/Command/EntityGenerator.php:173 +msgctxt "console" +msgid "Please enter entity name" +msgstr "Mohon masukkan nama entitas" + +#: Console/Command/EntityGenerator.php:179 +msgctxt "console" +msgid "Please enter valid entity name!" +msgstr "Mohon masukkan nama entitas yang sah!" + +#: Console/Command/EntityGenerator.php:188 +#, php-format +msgctxt "console" +msgid "Entity [%s] is invalid! class name contain reserved keyword!" +msgstr "Entitas [%s] tidak sah! nama kelas berisi kata kunci bawaan!" + +#: Console/Command/EntityGenerator.php:199 +#, php-format +msgctxt "console" +msgid "Table name [%s] is too long! Must be less or equal 64 characters" +msgstr "" +"Nama tabel [%s] terlalu panjang! Harus kurang dari atau sama dengan 64 " +"karakter" + +#: Console/Command/EntityGenerator.php:209 +#, php-format +msgctxt "console" +msgid "Entity [%s] exist" +msgstr "Entitas [%s] tersedia" + +#: Console/Command/EntityGenerator.php:239 +#, php-format +msgctxt "console" +msgid "%s Could not detect entity directory" +msgstr "%s Tidak dapat mendeteksi direktori entitas" + +#: Console/Command/EntityGenerator.php:276 +#, php-format +msgctxt "console" +msgid "Entity Name : %s" +msgstr "Nama Entitas : %s" + +#: Console/Command/EntityGenerator.php:288 +#, php-format +msgctxt "console" +msgid "Table Name : %s" +msgstr "Nama Tabel : %s" + +#: Console/Command/EntityGenerator.php:301 +#, php-format +msgctxt "console" +msgid "Entity Class : %s" +msgstr "Kelas Entitas : %s" + +#: Console/Command/EntityGenerator.php:313 +#, php-format +msgctxt "console" +msgid "Entity File : %s" +msgstr "Berkas Entitas : %s" + +#: Console/Command/EntityGenerator.php:361 +#, php-format +msgctxt "console" +msgid "%s Could not save entity!" +msgstr "%s Tidak dapat menyimpan entitas!" + +#: Console/Command/EntityGenerator.php:372 +#, php-format +msgctxt "console" +msgid "%s Entity successfully created!" +msgstr "%s Entitas berhasil dibuat!" + +#: Console/Command/MiddlewareGenerator.php:79 +msgctxt "console" +msgid "Generate middleware class." +msgstr "Hasilkan kelas middleware." + +#: Console/Command/MiddlewareGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Middleware will use prefix namespace with %s\n" +msgstr "" +"%s membantu Anda membuat objek %s.\n" +"\n" +"Middleware akan menggunakan awalan namespace dengan %s\n" + +#: Console/Command/MiddlewareGenerator.php:174 +msgctxt "console" +msgid "Please enter middleware class name" +msgstr "Mohon masukkan nama kelas middleware" + +#: Console/Command/MiddlewareGenerator.php:183 +msgctxt "console" +msgid "Please enter valid middleware class name!" +msgstr "Silakan masukkan nama kelas middleware yang sah!" + +#: Console/Command/MiddlewareGenerator.php:193 +#, php-format +msgctxt "console" +msgid "Middleware [%s] is invalid! class name contain reserved keyword!" +msgstr "Middleware [%s] tidak sah! nama kelas berisi kata kunci bawaan!" + +#: Console/Command/MiddlewareGenerator.php:204 +#, php-format +msgctxt "console" +msgid "Middleware [%s] exist" +msgstr "Middleware [%s] tersedia" + +#: Console/Command/MiddlewareGenerator.php:236 +#, php-format +msgctxt "console" +msgid "%s Could not detect middleware directory" +msgstr "%s Tidak dapat mendeteksi direktori middleware" + +#: Console/Command/MiddlewareGenerator.php:272 +#, php-format +msgctxt "console" +msgid "Middleware Name : %s" +msgstr "Nama Middleware : %s" + +#: Console/Command/MiddlewareGenerator.php:286 +#, php-format +msgctxt "console" +msgid "Middleware Class : %s" +msgstr "Kelas Middleware: %s" + +#: Console/Command/MiddlewareGenerator.php:298 +#, php-format +msgctxt "console" +msgid "Middleware File : %s" +msgstr "Berkas Middleware : %s" + +#: Console/Command/MiddlewareGenerator.php:348 +#, php-format +msgctxt "console" +msgid "%s Could not save middleware!" +msgstr "%s Tidak dapat menyimpan middleware!" + +#: Console/Command/MiddlewareGenerator.php:359 +#, php-format +msgctxt "console" +msgid "%s Middleware successfully created!" +msgstr "%s Middleware berhasil dibuat!" + +#: Console/Command/ModuleGenerator.php:79 +msgctxt "console" +msgid "Generate module class." +msgstr "Hasilkan kelas modul." + +#: Console/Command/ModuleGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Module will use prefix namespace with %s\n" +"Module only support single class name.\n" +msgstr "" +"%s membantu Anda membuat objek %s.\n" +"\n" +"Modul akan menggunakan awalan namespace dengan %s\n" +"Modul hanya mendukung nama kelas tunggal.\n" + +#: Console/Command/ModuleGenerator.php:174 +msgctxt "console" +msgid "Please enter module class name" +msgstr "Mohon masukkan nama kelas modul" + +#: Console/Command/ModuleGenerator.php:181 +msgctxt "console" +msgid "Please enter valid module class name!" +msgstr "Mohon masukkan nama kelas modul yang sah!" + +#: Console/Command/ModuleGenerator.php:192 +#, php-format +msgctxt "console" +msgid "Module [%s] is invalid! class name contain reserved keyword!" +msgstr "Modul [%s] tidak sah! nama kelas berisi kata kunci bawaan!" + +#: Console/Command/ModuleGenerator.php:203 +#, php-format +msgctxt "console" +msgid "" +"Module [%s] is invalid! Module only contain single class name, not " +"namespaced!" +msgstr "" +"Modul [%s] tidak sah! Modul hanya boleh berupa nama kelas tunggal, bukan " +"bermuatan namespace!" + +#: Console/Command/ModuleGenerator.php:214 +#, php-format +msgctxt "console" +msgid "Module [%s] is too long! Must be less or equal 128 characters" +msgstr "" +"Modul [%s] terlalu panjang! Harus kurang dari atau sama dengan 128 karakter" + +#: Console/Command/ModuleGenerator.php:224 +#, php-format +msgctxt "console" +msgid "Module [%s] exist" +msgstr "Modul [%s] tersedia" + +#: Console/Command/ModuleGenerator.php:254 +#, php-format +msgctxt "console" +msgid "%s Could not detect module directory" +msgstr "%s Tidak dapat mendeteksi direktori modul" + +#: Console/Command/ModuleGenerator.php:293 +#, php-format +msgctxt "console" +msgid "Module Name : %s" +msgstr "Name Modul : %s" + +#: Console/Command/ModuleGenerator.php:307 +#, php-format +msgctxt "console" +msgid "Module Class : %s" +msgstr "Kelas Modul : %s" + +#: Console/Command/ModuleGenerator.php:319 +#, php-format +msgctxt "console" +msgid "Module Namespace : %s" +msgstr "Namespace Modul : %s" + +#: Console/Command/ModuleGenerator.php:331 +#, php-format +msgctxt "console" +msgid "Module File : %s" +msgstr "Berkas Modul : %s" + +#: Console/Command/ModuleGenerator.php:381 +#, php-format +msgctxt "console" +msgid "%s Could not save module!" +msgstr "%s Tidak dapat menyimpan modul!" + +#: Console/Command/ModuleGenerator.php:392 +#, php-format +msgctxt "console" +msgid "%s Module successfully created!" +msgstr "%s Modul berhasil dibuat!" + +#: Console/Command/SchedulerAction.php:38 +msgctxt "console" +msgid "List or run scheduler." +msgstr "Daftar atau jalankan penjadwal." + +#: Console/Command/SchedulerAction.php:45 +msgctxt "console" +msgid "Run the pending schedulers" +msgstr "Jalankan penjadwal yang tertunda" + +#: Console/Command/SchedulerAction.php:51 +#, php-format +msgctxt "console" +msgid "The %s help you to list & run scheduler" +msgstr "%s membantu anda untuk membuat daftar & menjalankan penjadwal" + +#: Console/Command/SchedulerAction.php:78 +msgctxt "console" +msgid "Object scheduler is not valid" +msgstr "Object penjadwal tidak sah" + +#: Console/Command/SchedulerAction.php:102 +msgctxt "console" +msgid "No task in queue" +msgstr "Tidak ada tugas dalam antrian" + +#: Console/Command/SchedulerAction.php:112 +#, php-format +msgctxt "console" +msgid "Executing %s task" +msgid_plural "Executing %s tasks" +msgstr[0] "Mengeksekusi %s tugas" + +#: Console/Command/SchedulerAction.php:131 +msgctxt "console" +msgid "scheduler in queue to run" +msgid_plural "schedulers in queue to run" +msgstr[0] "penjadwal dalam antrian untuk dijalankan" + +#: Console/Command/SchedulerAction.php:144 +#: Console/Command/SchedulerAction.php:190 +#, php-format +msgctxt "console" +msgid "run every %s seconds" +msgstr "dijalankan setiap %s detik" + +#: Console/Command/SchedulerAction.php:152 +#: Console/Command/SchedulerAction.php:198 +#, php-format +msgctxt "console" +msgid "next executed time %s" +msgstr "waktu eksekusi berikutnya %s" + +#: Console/Command/SchedulerAction.php:177 +msgctxt "console" +msgid "scheduler skipped" +msgid_plural "schedulers skipped" +msgstr[0] "penjadwal dilewati" + +#: Console/Command/SchedulerGenerator.php:79 +msgctxt "console" +msgid "Generate scheduler class." +msgstr "Hasilkan kelas penjadwal." + +#: Console/Command/SchedulerGenerator.php:90 +#, php-format +msgctxt "console" +msgid "" +"The %s help you to create %s object.\n" +"\n" +"Scheduler will use prefix namespace with %s\n" +"Scheduler only support single class name.\n" +"\n" +msgstr "" +"%s membantu Anda membuat objek %s.\n" +"\n" +"Penjadwal akan menggunakan awalan namespace dengan %s\n" +"Penjadwal hanya mendukung nama kelas tunggal.\n" +"\n" + +#: Console/Command/SchedulerGenerator.php:174 +msgctxt "console" +msgid "Please enter scheduler class name" +msgstr "Mohon masukkan nama kelas penjadwal" + +#: Console/Command/SchedulerGenerator.php:181 +msgctxt "console" +msgid "Please enter valid scheduler class name!" +msgstr "Mohon masukkan nama kelas penjadwal yang sah!" + +#: Console/Command/SchedulerGenerator.php:192 +#, php-format +msgctxt "console" +msgid "Scheduler [%s] is invalid! class name contain reserved keyword!" +msgstr "Penjadwal [%s] tidak valid! nama kelas berisi kata kunci bawaan!" + +#: Console/Command/SchedulerGenerator.php:203 +#, php-format +msgctxt "console" +msgid "" +"Scheduler [%s] is invalid! Scheduler only contain single class name, not " +"namespaced!" +msgstr "" +"Penjadwal [%s] tidak sah! Penjadwal hanya boleh berupa nama kelas tunggal, " +"bukan bermuatan namespace!" + +#: Console/Command/SchedulerGenerator.php:214 +#, php-format +msgctxt "console" +msgid "Scheduler [%s] is too long! Must be less or equal 128 characters" +msgstr "" +"Penjadwal [%s] terlalu panjang! Harus kurang dari atau sama dengan 128 " +"karakter" + +#: Console/Command/SchedulerGenerator.php:225 +#, php-format +msgctxt "console" +msgid "Scheduler [%s] exist" +msgstr "Penjadwal [%s] tersedia" + +#: Console/Command/SchedulerGenerator.php:258 +#, php-format +msgctxt "console" +msgid "%s Could not detect scheduler directory" +msgstr "%s Tidak dapat mendeteksi direktori penjadwal" + +#: Console/Command/SchedulerGenerator.php:300 +#, php-format +msgctxt "console" +msgid "Scheduler Name : %s" +msgstr "Nama Penjadwal : %s" + +#: Console/Command/SchedulerGenerator.php:312 +#, php-format +msgctxt "console" +msgid "Scheduler Identity : %s" +msgstr "Identitas Penjadwal : %s" + +#: Console/Command/SchedulerGenerator.php:325 +#, php-format +msgctxt "console" +msgid "Scheduler Class : %s" +msgstr "Kelas Penjadwal : %s" + +#: Console/Command/SchedulerGenerator.php:337 +#, php-format +msgctxt "console" +msgid "Scheduler File : %s" +msgstr "Berkas Penjadwal : %s" + +#: Console/Command/SchedulerGenerator.php:386 +#, php-format +msgctxt "console" +msgid "%s Could not save scheduler!" +msgstr "%s Tidak dapat menyimpan penjadwal!" + +#: Console/Command/SchedulerGenerator.php:397 +#, php-format +msgctxt "console" +msgid "%s Scheduler successfully created!" +msgstr "%s Scheduler berhasil dibuat!" + +#: Console/Command/Traits/WriterHelperTrait.php:143 +#, php-format +msgctxt "console" +msgid "Time %s secs; Memory Usage: %s; Memory Peak Usage: %s" +msgstr "Waktu %s detik; Penggunaan Memori: %s; Penggunaan Puncak Memori: %s" + +#: Templates/Template.php:208 +msgctxt "template" +msgid "version" +msgstr "versi" + +#: Templates/Template.php:209 +msgctxt "template" +msgid "unknown" +msgstr "tak diketahui" diff --git a/src/Routing/AbstractController.php b/src/Routing/AbstractController.php index 13c6e4d..82c028d 100644 --- a/src/Routing/AbstractController.php +++ b/src/Routing/AbstractController.php @@ -73,14 +73,11 @@ final public function __construct(public readonly RouterInterface $router) * @template M as ModuleInterface * @psalm-param class-string $moduleClassName * @psalm-return ?M - * @throws Throwable */ public function getModule(string $moduleClassName): ?ModuleInterface { - return ContainerHelper::decorate( - Modules::class, - $this->getContainer() - )?->get($moduleClassName); + return ContainerHelper::service(Modules::class, $this->getContainer()) + ?->get($moduleClassName); } /** diff --git a/src/Templates/Abstracts/AbstractTemplateRule.php b/src/Templates/Abstracts/AbstractTemplateRule.php index e024f4c..097798b 100644 --- a/src/Templates/Abstracts/AbstractTemplateRule.php +++ b/src/Templates/Abstracts/AbstractTemplateRule.php @@ -31,6 +31,8 @@ abstract class AbstractTemplateRule protected string $jsonPath = self::METADATA_JSON; + protected ?string $templateLoad = 'template.php'; + private ?string $initializedDirectory = null; private array $templates = []; @@ -41,6 +43,11 @@ public function __construct(public readonly Wrapper $wrapper) { } + public function getTemplateLoad(): ?string + { + return $this->templateLoad; + } + public function setActive(string|AbstractTemplate $active): bool { if (is_string($active)) { diff --git a/src/Templates/Middlewares/TemplateLoaderMiddleware.php b/src/Templates/Middlewares/TemplateLoaderMiddleware.php new file mode 100644 index 0000000..20b4de2 --- /dev/null +++ b/src/Templates/Middlewares/TemplateLoaderMiddleware.php @@ -0,0 +1,57 @@ +getContainer()) + ?->getTemplateRule() + ->getActive(); + if ($active) { + // get template load + $templateName = $active->getTemplateRule()->getTemplateLoad(); + if (!$templateName) { + return $request; + } + $file = $active->getTemplateDirectory() . DIRECTORY_SEPARATOR . $templateName; + if (is_file($file)) { + try { + (fn($file) => include_once $file)->call($active, $file); + $this->getManager()->dispatch( + 'templates.templateFileLoaded', + $active, + $file + ); + } catch (Throwable $e) { + $logger = ContainerHelper::use( + LoggerInterface::class, + $this->getContainer() + ); + $logger->notice($e, context: ['mode' => 'templates_include']); + throw $e; + } + } + } + return $request; + } +} diff --git a/src/Templates/Template.php b/src/Templates/Template.php index 041c144..e922f69 100644 --- a/src/Templates/Template.php +++ b/src/Templates/Template.php @@ -205,8 +205,8 @@ public function __toString(): string return sprintf( '%s | %s : %s', $this->getName(), - $this->translate('version'), - $this->getVersion()??$this->translate('unknown') + $this->translateContext('version', 'template'), + $this->getVersion()??$this->translateContext('unknown', 'template') ); } } diff --git a/src/Traits/Service/TranslatorTrait.php b/src/Traits/Service/TranslatorTrait.php index e57a960..e7673e8 100644 --- a/src/Traits/Service/TranslatorTrait.php +++ b/src/Traits/Service/TranslatorTrait.php @@ -6,6 +6,9 @@ use ArrayAccess\TrayDigita\L10n\Translations\Interfaces\TranslatorInterface; use ArrayAccess\TrayDigita\Util\Filter\ContainerHelper; use Psr\Container\ContainerInterface; +use function is_numeric; +use function is_string; +use function str_contains; trait TranslatorTrait { @@ -13,6 +16,9 @@ trait TranslatorTrait abstract public function getContainer() : ?ContainerInterface; + /** + * @return ?TranslatorInterface + */ public function getTranslator() : ?TranslatorInterface { if ($this->translatorObject) { @@ -25,6 +31,12 @@ public function getTranslator() : ?TranslatorInterface ); } + /** + * @param string $original + * @param string $domain + * @param ?string $context + * @return string + */ public function translate( string $original, string $domain = TranslatorInterface::DEFAULT_DOMAIN, @@ -36,13 +48,27 @@ public function translate( : $original; } + /** + * @param string $singular + * @param string $plural + * @param int|float|numeric-string $number safe with numeric-string + * @param string $domain + * @param string|null $context + * @return string + */ public function translatePlural( string $singular, string $plural, - int|float $number, + int|float|string $number, string $domain = TranslatorInterface::DEFAULT_DOMAIN, ?string $context = null ): string { + if (is_string($number)) { + if (!is_numeric($number)) { + return $singular; + } + $number = str_contains($number, '.') ? (float) $number : (int) $number; + } $translator = $this->getTranslator(); if ($translator) { $translation = $this->getTranslator()->translatePlural( @@ -54,7 +80,134 @@ public function translatePlural( ); } return $translation ?? ( - $number === 1 || $number === 1.0 ? $singular : $plural + $number === 1 || $number === 1.0 ? $singular : $plural ); } + + /** + * Translate context + * + * @param string $original + * @param string $context + * @param string $domain + * @return string + * @see TranslatorInterface::translateContext() + */ + public function translateContext( + string $original, + string $context, + string $domain = TranslatorInterface::DEFAULT_DOMAIN, + ): string { + $translator = $this->getTranslator(); + return $translator + ? $this->getTranslator()->translateContext($original, $context, $domain) + : $original; + } + + /** + * Translate plural context + * + * @param string $singular + * @param string $plural + * @param int|float|numeric-string $number + * @param string $context + * @param string $domain + * @return string + */ + public function translatePluralContext( + string $singular, + string $plural, + int|float|string $number, + string $context, + string $domain = TranslatorInterface::DEFAULT_DOMAIN + ) : string { + if (is_string($number)) { + if (!is_numeric($number)) { + return $singular; + } + $number = str_contains($number, '.') ? (float) $number : (int) $number; + } + $translator = $this->getTranslator(); + if ($translator) { + $translation = $this->getTranslator()->translatePluralContext( + $singular, + $plural, + $number, + $context, + $domain + ); + } + + return $translation ?? ( + $number === 1 || $number === 1.0 ? $singular : $plural + ); + } + + /** + * Translate without context + * + * @param string $original + * @param string $domain + * @return string + */ + public function trans( + string $original, + string $domain = TranslatorInterface::DEFAULT_DOMAIN, + ): string { + return $this->translate($original, $domain); + } + + /** + * Translate with context + * + * @param string $original + * @param string $context + * @param string $domain + * @return string + */ + public function transX( + string $original, + string $context, + string $domain = TranslatorInterface::DEFAULT_DOMAIN, + ): string { + return $this->translateContext($original, $context, $domain); + } + + /** + * Translate plural without context + * + * @param string $singular + * @param string $plural + * @param int|float|numeric-string $number + * @param string $domain + * @return string + */ + public function transN( + string $singular, + string $plural, + int|float|string $number, + string $domain = TranslatorInterface::DEFAULT_DOMAIN, + ): string { + return $this->translatePlural($singular, $plural, $number, $domain); + } + + /** + * Translate plural without context + * + * @param string $singular + * @param string $plural + * @param int|float|numeric-string $number + * @param string $context + * @param string $domain + * @return string + */ + public function transNX( + string $singular, + string $plural, + int|float|string $number, + string $context, + string $domain = TranslatorInterface::DEFAULT_DOMAIN + ): string { + return $this->translatePluralContext($singular, $plural, $number, $context, $domain); + } } diff --git a/src/View/ErrorRenderer/HtmlTraceAbleErrorRenderer.php b/src/View/ErrorRenderer/HtmlTraceAbleErrorRenderer.php index 1d3782a..ed854d2 100644 --- a/src/View/ErrorRenderer/HtmlTraceAbleErrorRenderer.php +++ b/src/View/ErrorRenderer/HtmlTraceAbleErrorRenderer.php @@ -6,6 +6,7 @@ use ArrayAccess\TrayDigita\Exceptions\Runtime\MaximumCallstackExceeded; use ArrayAccess\TrayDigita\Http\Exceptions\HttpException; use ArrayAccess\TrayDigita\Kernel\Interfaces\KernelInterface; +use ArrayAccess\TrayDigita\Util\Filter\Consolidation; use ArrayAccess\TrayDigita\Util\Filter\ContainerHelper; use ArrayAccess\TrayDigita\View\Interfaces\ViewInterface; use Composer\Autoload\ClassLoader; @@ -22,14 +23,21 @@ use function htmlentities; use function htmlspecialchars; use function implode; +use function ini_set; use function is_string; use function json_encode; +use function nl2br; +use function phpinfo; use function preg_match; use function preg_quote; use function preg_replace; +use function preg_replace_callback; +use function print_r; use function realpath; use function sprintf; +use function str_contains; use function str_replace; +use function str_starts_with; use function trim; use const CONFIG_FILE; use const JSON_UNESCAPED_SLASHES; @@ -158,6 +166,14 @@ public function renderHtmlBody(string $title = '', string $html = ''): string private function fromTrace(array $trace, &$traceCount) : array { + Consolidation::callbackReduceError(static function () { + ini_set('highlight.comment', '#FF8000'); + ini_set('highlight.default', '#0000BB'); + ini_set('highlight.html', '#000000'); + ini_set('highlight.keyword', '#007700'); + ini_set('highlight.string', '#DD0000'); + }); + $traceCount++; $contentOffset = 10; // $startLine = null; @@ -223,10 +239,10 @@ private function fromTrace(array $trace, &$traceCount) : array $line++; $lineContent = $spl->getCurrentLine(); $spl->next(); - if (($line+$contentOffset) < $trace['line']) { + if (($line + $contentOffset) < $trace['line']) { continue; } - if (($line-$contentOffset) > $trace['line']) { + if (($line - $contentOffset) > $trace['line']) { break; } $insideContent .= "\n$lineContent"; @@ -237,12 +253,24 @@ private function fromTrace(array $trace, &$traceCount) : array str_replace( ['
', '
'], '
', - highlight_string("", highlight_string(")( +\S| +)~', + static fn ($e) => $e[1] .str_replace(' ', ' ', $e[2]), + $lineContent[1] + ); $lineContent = implode($lineContent); + if (str_starts_with($lineContent, ']*>(.*)$~', + '$1', + $lineContent + ); + } } $theLine .= sprintf( '%2$d', @@ -482,6 +510,8 @@ private function exceptionDetail(Throwable $exception): string } code, pre, .traced-content-details { + margin:0; + padding: 0; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; } @@ -711,11 +741,21 @@ private function exceptionDetail(Throwable $exception): string } .traced-content-details > div { - padding-left: .5rem; + padding-left: .3rem; white-space: nowrap; } - -.traced-content-line span.current, .traced-content-details .current { +.traced-content-line, +.traced-content-details { + padding-top: 0; +} +.traced-content-line span[data-line], +.traced-content-details > div[data-line] { + padding-top: 0rem; + padding-bottom: 0rem; +} +.traced-content-line span.current, +.traced-content-details .current, +.traced-content-details > div.current[data-line]{ background: rgba(0,0,0,.1); padding-top: 1rem; padding-bottom: 1rem; diff --git a/src/View/Twig/TwigExtensions/Translator.php b/src/View/Twig/TwigExtensions/Translator.php index 062f59b..9ca22cd 100644 --- a/src/View/Twig/TwigExtensions/Translator.php +++ b/src/View/Twig/TwigExtensions/Translator.php @@ -3,96 +3,45 @@ namespace ArrayAccess\TrayDigita\View\Twig\TwigExtensions; -use ArrayAccess\TrayDigita\L10n\Translations\Interfaces\TranslatorInterface; use ArrayAccess\TrayDigita\Traits\Service\TranslatorTrait; -use Twig\TwigFilter; use Twig\TwigFunction; -use function is_array; -use function is_numeric; -use function is_scalar; -use function is_string; -use function round; class Translator extends AbstractExtension { use TranslatorTrait; - public function doTranslate( - $original = '', - $domain = null, - $context = null - ): string { - $original = is_scalar($original) ? (string) $original : ''; - if ($original === '') { - return ''; - } - $context = !is_array($context) ? null : $context; - $domain = !is_string($domain) ? null : $domain; - $domain ??= TranslatorInterface::DEFAULT_DOMAIN; - return $this->translate($original, $domain, $context); - } - - public function doTranslatePlural( - $singular = '', - $plural = null, - $number = 1, - $domain = null, - $context = null - ): string { - $number = is_numeric($number) ? (int) (str_contains($number, '.') ? round($number) : $number): 1; - $singular = is_scalar($singular) ? (string) $singular : ''; - if ($singular === '') { - return ''; - } - if (!is_scalar($plural)) { - return $singular; - } - $plural = (string) $plural; - $context = !is_array($context) ? null : $context; - $domain = !is_string($domain) ? null : $domain; - $domain ??= TranslatorInterface::DEFAULT_DOMAIN; - return $this->translatePlural( - $singular, - $plural, - $number, - $domain, - $context - ); - } - public function getFunctions() : array { return [ new TwigFunction( 'translate', - [$this, 'doTranslate'] + [$this, 'translate'] + ), + new TwigFunction( + 'trans', + [$this, 'trans'] ), new TwigFunction( '__', - [$this, 'doTranslate'] + [$this, 'trans'] ), new TwigFunction( - 'translate_plural', - [$this, 'doTranslatePlural'] + '_x', + [$this, 'transX'] ), new TwigFunction( '_n', - [$this, 'doTranslatePlural'] + [$this, 'transN'] + ), + new TwigFunction( + '_nx', + [$this, 'transNX'] ), ]; } public function getFilters(): array { - return [ - new TwigFilter( - 'translate', - [$this, 'doTranslate'] - ), - new TwigFilter( - 'translate_plural', - [$this, 'doTranslatePlural'] - ) - ]; + return []; } } diff --git a/src/Web.php b/src/Web.php index 4dc2c03..b9fa954 100644 --- a/src/Web.php +++ b/src/Web.php @@ -46,6 +46,7 @@ use function realpath; use function strlen; use function substr; +use function var_dump; use const DIRECTORY_SEPARATOR; use const PHP_SAPI; use const PHP_VERSION_ID; @@ -216,7 +217,8 @@ final public static function serve() /** * @var Kernel $kernel */ - $kernel = Decorator::init(); + $kernel = Decorator::kernel(); + $kernel->init(); $request = ServerRequest::fromGlobals( Decorator::service(ServerRequestFactoryInterface::class), Decorator::service(StreamFactoryInterface::class) @@ -254,6 +256,7 @@ public static function showError(Throwable $e, $kernel = null) $title = $e->getTitle(); $errorDescription = $e->getDescription(); } + if (!headers_sent()) { header('Content-Type: text/html', true, $code); $root = preg_quote(dirname(__DIR__), '~');