title: ROR: Localised Message String Variable Substitution
body: <p>I am trying to work out the best way to replace multiple variables/placeholders within localized message string in my ruby on rails application. When replacing a single placeholder I have used the satisfactory:</p>
  
  <p>In en.yml:
      url_borked: "The URL: $url could not be loaded."
  In view:
      t(:url_borked)["$url"] = request.url</p>
  
  <p>But this is not suitable for multiple placeholders. It looks ugly, and it doesn't actually work e.g:</p>
  
  <p>In en.yml:</p>
  
  <pre><code>url_borked: "The URL: $url is badly formatted, perhaps you meant: $url_clean"
  </code></pre>
  
  <p>In view:</p>
  
  <pre><code>(t(:url_borked)["$url"] = request.url)["url_clean") = @suggested_url
  </code></pre>
  
  <p>I have tried using String::sub, but am not happy with that as it ugly. e.g.: </p>
  
  <pre><code>(t(:url_borked).sub("$url", request.url).sub("url_clean", @suggested_url)
  </code></pre>
  
  <p>It also doesn't work if you want to replace multiple instances of the one placeholder. e.g.:</p>
  
  <pre><code>bad_url: "$url cannot be loaded, please try $url another time"
  </code></pre>
  
  <p>I have also considered the printf function, but that does not work for localisation as the relative position of the placeholder can change depending on the translation.</p>
  
  <p>Is there correct way to do this message placeholder substitution?</p>
  
  <p>Thanks.</p>