Last Updated: February 25, 2016
·
850
· errm

Use urls as translation keys

Urls have dots in them, so you need to override the default separator in I18n to use them as translation keys.

es-ES:
  url:
    scope:
      http://kittens.co.uk: "http://gatitos.es"


 I18n.t "http://www.kittens.co.uk", 
            :scope => [:url, :scope], 
            :locale => "es-ES"
>>"translation missing:es-ES.url.scope.http://kittens.co.uk"

I18n.t "http://kittens.co.uk", 
          :scope => [:url, :scope], 
          :separator => "^", 
          :locale => "es-ES"
>> "http://gatitos.es"