Closed NicolasRoehm closed 4 years ago
No, the closest to that would be catching the exception and handling it by outputting the key.
I tend to discourage the use of "method 1" (https://stackoverflow.com/q/10654056/404623) for internationalization, however if that isn't the use case for falling back to the key as a default then I am happy to hear other use cases for that behaviour.
I'm used to code with ngx-translate which provides this type of fallback. Precisely, with "method 2" we immediately see which key is missing. When doing front-end work, I prefer to stay focused on the template files and quickly check the result instead of going to the translation file each time I add a key. Another cool thing is that I can add another language and translate the keys gradually and in particular with the context of the screen.
I will consider accepting the feature as a configuration setting if you want to make a pull request.
Can you please update the Composer package ? :) Thank you very much!
Is it possible to fallback with the given key instead of showing the
Invalid key
error ?