If I want to translate content in symfony, I will use the translator as it is described in the book:
$translated = $this->get('translator')->trans('Symfony2 is great');
But, if this translations are already existing in a database, how can I access this?
The db looks like
ID | locale | type | field | content
1 | en | message| staff.delete | delete this user?
I wil have to tell the translator where he can get the translation information. Cann you help me with a good tutorial or tipps an tricks?
According to docs you need to register a service in order to load translations from other source like from database
What i have done,i have a translation bundle where my translation entity resides so i have registered a service in config.yml and passed doctrine manager
@doctrine.orm.entity_manager
in order to get data from entityIn
DBLoader
class i have fetched translations from database and sets as mentioned in docstranslation.loader
My Loader class