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:
parent
f50c382979
commit
af999971b4
@ -82,7 +82,7 @@ class MessageSelector
|
|||||||
return $standardRules[0];
|
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];
|
return $standardRules[$position];
|
||||||
|
Reference in New Issue
Block a user