Reproduction
1) Setup the files for minimal reproduction, see below.
2) Run the first command, it will output "foo:bar:baz" and "translated" is true.
3) Run the second command, it will output "foo::baz" but "translated" is false.
4) Run the third command, it will output "foobaz" and "translated" is true.
The Issue
It is expected that an invalid locale string will display an error when printed, such as "Unknown key" and this would also cause a translation request to fail. However in the case described above the locale string is valid and is printed without error but the translation request fails. This is inconsistent behaviour because one is successful while the other fails. Additionally, it only fails when using a locale key, it will not fail during concatenation. If for some reason this locale string is not valid, then it is not documented that this would cause a failure and no error message is printed.
Files