From af999971b42536b512ba0c0d2abf00213d273671 Mon Sep 17 00:00:00 2001 From: t3chn0r Date: Wed, 14 May 2014 09:24:58 -0400 Subject: [PATCH] Update MessageSelector.php to show which value was passed When the translator can't find a correct match using transChoice() a string is logged today with the following text: Unable to choose a translation for "" with locale "". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples"). This change introduces the value that was passed to transChoice() to the developer will have more information as to what value did not match any of the translation options: Unable to choose a translation for "" with locale "" for value "". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples"). --- src/Symfony/Component/Translation/MessageSelector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Translation/MessageSelector.php b/src/Symfony/Component/Translation/MessageSelector.php index 1802d16e27..cdf814e45e 100644 --- a/src/Symfony/Component/Translation/MessageSelector.php +++ b/src/Symfony/Component/Translation/MessageSelector.php @@ -82,7 +82,7 @@ class MessageSelector return $standardRules[0]; } - throw new \InvalidArgumentException(sprintf('Unable to choose a translation for "%s" with locale "%s". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $message, $locale)); + throw new \InvalidArgumentException(sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $message, $locale, $number)); } return $standardRules[$position];