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"
Written by Ed
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#