title: Symfony: Load resources into the Translator from within a Service
body: <p>I'm working on a Symfony (2.7.4) website where some users have their own language resources for their own locales. For example, a user might have two locales (for example <code>fr</code> and <code>en</code>) and another user could also have one or all of these locales.</p>
  
  <p>Each user has the ability to edit its own translations in a third party app, so translations are not shared between users.</p>
  
  <p>I would like to be able to load the appropriate (YML or XLIFF) resources file when accessing a user's page, based on the locale (which is defined in the URL) and the user (could be its ID or anything that identifies it).</p>
  
  <p>For example, when visiting <code>user99.my-domain.ext/fr/</code> I'd like to add <code>[base_directory]/user99/messages.fr.yml</code> to the resources loaded by the Translator so it overrides the keys in the base <code>messages.fr.yml</code>.</p>
  
  <p>I've tried to inject the Translator in my service, but I can only use it for reading translations, not adding any. What would be the best way to do that? Or is doing it in a service is too late? Maybe the Kernel is a better place?</p>
  
  <p>Any help is appreciated!</p>
  
  <p>Note: I'm using the YAML format in my examples, but any of the Symfony-known formats is eligible.</p>