Gettext html in translation

Yeah, that’s how you do it.

You can also do the following (this is an example from a production app with translations):

<p>
  <%= gettext("Already have an account? %{sign_in} to continue", sign_in: safe_to_string(link(gettext("Sign in"), to: Routes.session_path(@conn, :new)))) |> raw() %>
</p>

A translator will usually have difficulty when there’s inline HTML, unless it’s very simple. There can also be issues with the open and close tags unless your translation platform verifies that these interpolations are intact and in the right order. I would keep all HTML out of the translations.