Q:

Terms and conditions internationalization with links

Hi guys i have a question about Internalization and the terms and condition:
in my view i have this:
I18n.t("user.registration.form.accept_terms_conditions", :conditions => link_to(I18n.t("user.registration.form.conditions"), page_url('privacy_policy')), :terms => link_to(I18n.t("user.registration.form.terms"), page_url('terms_and_conditions')))

and in my it.yml i have this:
accept_terms_conditions: "Accetto le %{conditions} e i %{terms}"
  conditions: "condizioni sulla privacy"
  terms: "termini di utilizzo"

The problem is that the result is not what i expected, messing the virables.
what i want its just this: 

Accetto le condizioni sulla privacy e i termini di utilizzo

how should i do this?
Thanks a lot!
Massimo

A:

There is a namespacing problem with your YAML. In this case accept_terms_conditions is a namespace so it can't have content directly - it needs a child namespace to contain the content.
For example, you could structure your translation like this :
accept_terms_conditions:
  text: "Accetto le %{conditions} e i %{terms}"
  conditions: "condizioni sulla privacy"
  terms: "termini di utilizzo"

and the .t call in your view would look like this :
I18n.t("accept_terms_conditions.text",
  :conditions => link_to(I18n.t("accept_terms_conditions.conditions"), page_url('privacy_policy')),
  :terms => link_to(I18n.t("accept_terms_conditions.terms"), page_url('terms_and_conditions')))

