rails i18n - translating text with links inside

后端 未结 9 801
名媛妹妹
名媛妹妹 2020-11-30 21:05

I\'d like to i18n a text that looks like this:

Already signed up? Log in!

Note that there is a link on the text. On this example

9条回答
  •  孤独总比滥情好
    2020-11-30 21:31

    Why not use the first way, but splitting it up like

    log_in_message: Already signed up?
    log_in_link_text: Log in!
    

    And then

    <%= t('log_in_message') %> <%= link_to t('log_in_link_text'), login_path %>

提交回复
热议问题