Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails translation missing error

I have set flash message in my controller like this

flash[:error] = t 'auth.login.empty'

My en.yml file has

en:
  auth:
    login:
      success: "Successfully logged in"
      empty: "Empty field cannot accespted"
      error: "Username and password doesn't match"

All are two space indent

I am getting flash as translation missing: en.auth.login.empty

Whether i have to make some configuration changes.

like image 998
Prabhakaran Avatar asked Jan 20 '26 21:01

Prabhakaran


1 Answers

I just ran into this.

A key I was setting at the top of my file was being over-written later on in the file:

# This was showing up as missing
invite:
  intent_msg: "Test intent message."

# because waaaay farther down the file I had the following:

invite:
  button_text: "<i class='fi-mail'></i> Send Invite"

Even though the two translations are for different keys, the second one was killing off the first one.

So now I have this:

invite:
  intent_msg: "Test intent message."
  button_text: "<i class='fi-mail'></i> Send Invite"

And all is well again. Watch out for that one folks.

like image 88
stephenmurdoch Avatar answered Jan 22 '26 14:01

stephenmurdoch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!