Skip to content

Commit 12e1c9b

Browse files
bug #29344 Fixes sprintf(): Too few arguments in Translator (stephanedelprat)
This PR was submitted for the master branch but it was merged into the 4.2 branch instead (closes #29344). Discussion ---------- Fixes sprintf(): Too few arguments in Translator | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | related to a previous deprecation <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | ? | Fixed tickets | none | License | MIT | Doc PR | none Fixes the log produced when the method is called : Before : "sprintf(): Too few arguments" After : "The "Symfony\Component\Translation\Translator::transChoice()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%count%" parameter." Reference : http://php.net/manual/function.sprintf.php Commits ------- 45c3de0 Fixes sprintf(): Too few arguments in Translator
2 parents 1aaf73e + 45c3de0 commit 12e1c9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Translation/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function trans($id, array $parameters = array(), $domain = null, $locale
226226
*/
227227
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
228228
{
229-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%count%" parameter.', __METHOD__), E_USER_DEPRECATED);
229+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED);
230230

231231
if (!$this->formatter instanceof ChoiceMessageFormatterInterface) {
232232
throw new LogicException(sprintf('The formatter "%s" does not support plural translations.', \get_class($this->formatter)));

0 commit comments

Comments
 (0)