Skip to content

Commit

Permalink
Merge 0dbd10a into bbf6cd1
Browse files Browse the repository at this point in the history
  • Loading branch information
universe-42 committed Jan 10, 2019
2 parents bbf6cd1 + 0dbd10a commit 38143b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -7,7 +7,7 @@
"ext-intl": "*",
"ext-tokenizer": "*",
"nette/di": "^3.0",
"nette/neon": "v3.0.0-beta1",
"nette/neon": "^3.0",
"nette/safe-stream": "^2.3",
"nette/utils": "^3.0",
"psr/log": "^1.0"
Expand Down
4 changes: 3 additions & 1 deletion src/Translate/Translator.php
Expand Up @@ -77,7 +77,7 @@ public function setLocale(string $locale): TranslatorInterface
}


public function translate($message, int $count = NULL): string
public function translate($message, ...$parameters): string
{
// avoid processing for empty values
if ($message === NULL || $message === '') {
Expand All @@ -89,6 +89,8 @@ public function translate($message, int $count = NULL): string
$message = (string) $message;
}

$count = isset($parameters[0]) ? $parameters[0] : NULL;

// numbers are formatted using locale settings (count parameter is used to define decimals)
if (is_numeric($message)) {
return $this->formatNumber($message, (int) $count);
Expand Down

0 comments on commit 38143b0

Please sign in to comment.