Automatically Add Missing Translations¶
When you are visiting a page the Symfony
record what translations are being used. The translations marked as “Missing” will
be added to the storage.
# config/config.yaml translation: # .. auto_add_missing_translations: enabled: true config_name: 'default' # ..
That’s it. You do not have to do anything more. Translations will automatically pop up in your storage.
TranslationDataCollector is not used in production environment (this file is linked with the profiler).
For use in production, you need to decorate the translator :
translator.data_collector: class: Symfony\Component\Translation\DataCollectorTranslator decorates: translator arguments: ['@translator.data_collector.inner']