Note that there are some explanatory texts on larger screens.

plurals
  1. PORails Internationalization, html tag
    text
    copied!<p>I'm having some problems having html tags correctly loaded in my Rails 3.2 app, and have no clue why. I managed to get it working for one flash message, but I am not managing to do it with a confirmation message.</p> <p>Any ideas ?</p> <p>My pt.yml file extract :</p> <pre><code> buttons: accept_terms: "Aceito os termos e condições" save: "Gravar" delete: "Apagar" add_new_receipt: "+" add_receipt_label: "Clique para adicionar novo recibo" download_all_html: "Tem a certeza que deseja descarregar todos os ficheiros correspondentes à pesquisa? &lt;br /&gt; Esta operação pode demorar algum tempo, dependendo do número de ficheiros e da sua ligação à Internet " </code></pre> <p>my view code:</p> <pre><code>&lt;%= link_to (t :download_all, scope: "pages.home.customers"), user_download_all_path(user_id:current_user.id, is_retailer: params[:controller]=='suppliers' ? true : false), method: :post, class: "btn btn-primary", confirm: t(:download_all_html, scope: "buttons") %&gt; </code></pre> <p>In the end, My confirmation message shows the <code>&lt;br /&gt;</code> as is....</p> <p>I believe I am following rails <a href="http://guides.rubyonrails.org/i18n.html#using-safe-html-translations" rel="nofollow">guidelines</a> here, so any help would be appreciated to figure this one out.</p> <p><strong>Edit</strong></p> <p>I had already tried html_safe.</p> <p>I have one other example that is working :</p> <pre><code>tags: error_message_html: "O número %{message} ou não existe ou já foi mapeado.&lt;br /&gt; Por favor verifique que o número corresponde à empresa seleccionada " </code></pre> <p>and I invoke it inside a controller :</p> <pre><code>flash[:error] = t :error_message_html, scope: "forms.tags", message: params[:tag][:number] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload