Following the 4.3 documentation about translations (https://symfony.com/doc/4.3/translation.html#basic-translation), I'm trying to translate a page title.
I don't want to fallback to anything if the translation doesn't exist for the current locale.
Right now, I'm getting the default locale translation if it exists or the first translation it can find.
How can I disable that? Here's my /config/packages/translation.yaml file:
framework:
default_locale: de
translator:
default_path: '%kernel.project_dir%/translations'
Here's the code inside my controller:
/** @var TranslatorInterface $translatorInterface */
$categoryTitle = $translatorInterface->trans('category_title',[]);
As long as the translation key 'category_title' exists in any messages.*.yaml, I'm getting a value.