diff --git a/Formatter/IntlFormatter.php b/Formatter/IntlFormatter.php index ad4a45b9..9101a63a 100644 --- a/Formatter/IntlFormatter.php +++ b/Formatter/IntlFormatter.php @@ -40,7 +40,7 @@ public function formatIntl(string $message, string $locale, array $parameters = try { $this->cache[$locale][$message] = $formatter = new \MessageFormatter($locale, $message); } catch (\IntlException $e) { - throw new InvalidArgumentException(sprintf('Invalid message format (error #%d): %s.', intl_get_error_code(), intl_get_error_message()), 0, $e); + throw new InvalidArgumentException(sprintf('Invalid message format (error #%d): '.intl_get_error_message(), intl_get_error_code()), 0, $e); } } @@ -52,7 +52,7 @@ public function formatIntl(string $message, string $locale, array $parameters = } if (false === $message = $formatter->format($parameters)) { - throw new InvalidArgumentException(sprintf('Unable to format message (error #%s): %s.', $formatter->getErrorCode(), $formatter->getErrorMessage())); + throw new InvalidArgumentException(sprintf('Unable to format message (error #%s): '.$formatter->getErrorMessage(), $formatter->getErrorCode())); } return $message; diff --git a/Loader/XliffFileLoader.php b/Loader/XliffFileLoader.php index 6ae1fea2..248974b4 100644 --- a/Loader/XliffFileLoader.php +++ b/Loader/XliffFileLoader.php @@ -58,7 +58,7 @@ private function extract($resource, MessageCatalogue $catalogue, string $domain) $xliffVersion = XliffUtils::getVersionNumber($dom); if ($errors = XliffUtils::validateSchema($dom)) { - throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s.', $resource, XliffUtils::getErrorsAsString($errors))); + throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: '.XliffUtils::getErrorsAsString($errors), $resource)); } if ('1.2' === $xliffVersion) { diff --git a/Tests/Loader/JsonFileLoaderTest.php b/Tests/Loader/JsonFileLoaderTest.php index d264bb16..c5a9ca64 100644 --- a/Tests/Loader/JsonFileLoaderTest.php +++ b/Tests/Loader/JsonFileLoaderTest.php @@ -50,7 +50,7 @@ public function testLoadNonExistingResource() public function testParseException() { $this->expectException('Symfony\Component\Translation\Exception\InvalidResourceException'); - $this->expectExceptionMessage('Error parsing JSON - Syntax error, malformed JSON'); + $this->expectExceptionMessage('Error parsing JSON: Syntax error, malformed JSON'); $loader = new JsonFileLoader(); $resource = __DIR__.'/../fixtures/malformed.json'; $loader->load($resource, 'en', 'domain1');