Can you gain a Silver with Trader if the original supply pile was empty?
"When...would" text is only applied when the event specified actually would occur; if it is impossible for any reason, then the conditional is ignored.  The following is the relevant section in the FAQ:


  19.2 "When would"
  
  An ability that happens when an event would occur (such as when you would gain a card), happens before the event actually occurs (before you gain the card). Note however that this ability can only happen if the event would have otherwise occurred, i.e. if the event would have occurred if no when-would abilities had interfered (so you cannot for instance trigger a when-would-gain ability when "trying" to gain a card that's not available in Supply)


Donald X explicitly refers to this exact situation in this post on BoardGameGeek:


  Trader only works if you really would gain a card. If you try to gain a card from an empty pile, you can't use Trader then. I see how this is a question and sadly it is not covered in the FAQ.