Release 2.20.0 (#4987)

This commit is contained in:
Kevin Papst
2024-08-04 18:22:27 +02:00
committed by GitHub
parent 0947b88d36
commit ff6a3e8262
101 changed files with 441 additions and 458 deletions

View File

@@ -28,7 +28,11 @@ use Symfony\Component\HttpClient\HttpClient;
#[AsCommand(name: 'kimai:translations')]
final class TranslationCommand extends Command
{
public function __construct(private string $projectDirectory, private string $kernelEnvironment, private LocaleService $localeService)
public function __construct(
private readonly string $projectDirectory,
private readonly string $kernelEnvironment,
private readonly LocaleService $localeService
)
{
parent::__construct();
}
@@ -70,6 +74,7 @@ final class TranslationCommand extends Command
$sources = [];
if ($input->getOption('source') !== null) {
/** @var string $tmp */
$tmp = $input->getOption('source');
foreach ($bases as $directory) {
$files = glob($directory);
@@ -95,6 +100,7 @@ final class TranslationCommand extends Command
$targets = [];
if ($input->getOption('target') !== null) {
/** @var string $tmp */
$tmp = $input->getOption('target');
foreach ($bases as $directory) {
$files = glob($directory);
@@ -402,7 +408,7 @@ final class TranslationCommand extends Command
$xmlContent = '';
foreach ($translations as $id => $values) {
$xmlContent .= sprintf(
$xmlContent .= \sprintf(
'<trans-unit id="%s" resname="%s"><source>%s</source><target>%s</target></trans-unit>',
$id,
$values['resname'],
@@ -463,7 +469,7 @@ final class TranslationCommand extends Command
if (!\array_key_exists($key, $translations)) {
throw new \Exception(
sprintf('Missing english translation for key: %s in file %s', $key, $file)
\sprintf('Missing english translation for key: %s in file %s', $key, $file)
);
}
$unit->target[0] = $translations[$key];