Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -141,7 +141,7 @@ EOF
switch ($format) {
case 'xlf20': $xliffVersion = '2.0';
// no break
// no break
case 'xlf12': $format = 'xlf';
}
@@ -159,7 +159,7 @@ EOF
if ($force) {
foreach ($providerTranslations->getCatalogues() as $catalogue) {
$operation = new TargetOperation((new MessageCatalogue($catalogue->getLocale())), $catalogue);
$operation = new TargetOperation(new MessageCatalogue($catalogue->getLocale()), $catalogue);
if ($intlIcu) {
$operation->moveMessagesToIntlDomainsIfPossible();
}

View File

@@ -130,16 +130,16 @@ EOF
$force = $input->getOption('force');
$deleteMissing = $input->getOption('delete-missing');
if (!$domains && $provider instanceof FilteringProvider) {
$domains = $provider->getDomains();
}
// Reading local translations must be done after retrieving the domains from the provider
// in order to manage only translations from configured domains
$localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths);
if (!$domains) {
if ($provider instanceof FilteringProvider) {
$domains = $provider->getDomains();
}
if (!$domains) {
$domains = $this->getDomainsFromTranslatorBag($localTranslations);
}
$domains = $this->getDomainsFromTranslatorBag($localTranslations);
}
if (!$deleteMissing && $force) {

View File

@@ -47,7 +47,7 @@ class IcuResFileDumper extends FileDumper
$data .= pack('V', \strlen($target))
.mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8')
.$this->writePadding($data)
;
;
}
$resOffset = $this->getPosition($data);
@@ -56,7 +56,7 @@ class IcuResFileDumper extends FileDumper
.$indexes
.$this->writePadding($data)
.$resources
;
;
$bundleTop = $this->getPosition($data);

View File

@@ -62,7 +62,7 @@ class MoFileDumper extends FileDumper
.$targetOffsets
.$sources
.$targets
;
;
return $output;
}

View File

@@ -1,4 +1,4 @@
Copyright (c) 2004-2022 Fabien Potencier
Copyright (c) 2004-2023 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -25,7 +25,7 @@ class PhpFileLoader extends FileLoader
*/
protected function loadResource(string $resource): array
{
if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
self::$cache = null;
}

View File

@@ -155,19 +155,14 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
*/
public function add(array $messages, string $domain = 'messages')
{
if (!isset($this->messages[$domain])) {
$this->messages[$domain] = [];
}
$intlDomain = $domain;
if (!str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) {
$intlDomain .= self::INTL_DOMAIN_SUFFIX;
}
$altDomain = str_ends_with($domain, self::INTL_DOMAIN_SUFFIX) ? substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)) : $domain.self::INTL_DOMAIN_SUFFIX;
foreach ($messages as $id => $message) {
if (isset($this->messages[$intlDomain]) && \array_key_exists($id, $this->messages[$intlDomain])) {
$this->messages[$intlDomain][$id] = $message;
} else {
$this->messages[$domain][$id] = $message;
}
unset($this->messages[$altDomain][$id]);
$this->messages[$domain][$id] = $message;
}
if ([] === ($this->messages[$altDomain] ?? null)) {
unset($this->messages[$altDomain]);
}
}

View File

@@ -283,7 +283,7 @@ final class PseudoLocalizationTranslator implements TranslatorInterface
}
$visibleLength = $this->strlen($visibleText);
$missingLength = (int) (ceil($visibleLength * $this->expansionFactor)) - $visibleLength;
$missingLength = (int) ceil($visibleLength * $this->expansionFactor) - $visibleLength;
if ($this->brackets) {
$missingLength -= 2;
}

View File

@@ -9,6 +9,10 @@
* file that was distributed with this source code.
*/
if ('cli' !== \PHP_SAPI) {
throw new Exception('This script must be run from the command line.');
}
$usageInstructions = <<<END
Usage instructions