Rails i18: Translation missing error in yml files

Viewed 12

views/ipl_mailer/confirm_doctor_form_submitted_complete.html.slim

p Dear #{@doctor.display_name},

p #{t('.thank_you')}

locales/ipl/en.yml

ipl: &ipl
  ipl:
    cases_review_forms:
      form: &form
        would_approve: "Approve(Yes/No)"
      edit:
        <<: *form
  ipl_mailer:
    confirm_doctor_form_submitted_complete:
      thank_you: 'Thank you for reviewing your ClinCheck treatment plans. We have received your response and noted that all plans are approved.'

I am getting the following error:

I18n.t("thank_you") "translation missing: en-US.thank_you"

Is it because im doing it in en.yml file instead of en-US.yml

1 Answers

your I18n is trying to find element in yml file inside en-US

yml file should be as below:

en:
  ipl: &ipl
    ipl_mailer:
      confirm_doctor_form_submitted_complete:
        thank_you: 'Thank you for' 

then you can access it as below:

I18n.t('ipl.ipl_mailer.confirm_doctor_form_submitted_complete.thank_you')
Related