rails i18n - translating text with links inside

后端 未结 9 808
名媛妹妹
名媛妹妹 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:34

    I took hollis solution and made a gem called it out of it. Let's look at an example:

    log_in_message: "Already signed up? %{login:Log in!}"
    

    And then

    <%=t_link "log_in_message", :login => login_path %>

    For more details, see https://github.com/iGEL/it.

提交回复
热议问题