简体   繁体   中英

Rails Localization with Interpolation, how to do with link_to?

please help, im stuck:

I want to localize something like "Please contact support <%= mail_to 'support@mail.de' %> for more informations'.

But how to do?

I try something like:

<%= t('.contact_support', :mail => ______????) %>

Thanks for your help

Solution:

en:
  emails:
    contact_support: 'Please contact %{email}'

<%= t('.contact_support', :email => 'support@mail.de') %>

You can create an entry in your translation like:

en:
  emails:
    contact_support: 'Please contact support@mail.de'

and then in your view:

<%= t('emails.contact_support') %>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM