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:
<code>Unable to choose a translation for "<string>" with locale "<locale>". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").</code>
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:
<code>Unable to choose a translation for "<string>" with locale "<locale>" for value "<value>". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").</code>
This commit is contained in:
t3chn0r 2014-05-14 09:24:58 -04:00
parent f50c382979
commit af999971b4
1 changed files with 1 additions and 1 deletions

View File

@ -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];