hsntngr's avatar

Laravel validation errors doesn't work properly - localization issue

I have several languages on my application and I'm using laravellocalization package (Here is github page)

Well package works fine, I checked both of Laravellocalization::getCurrentLocale() and App::getLocale(). Both of them gave me correct locale..

But still when some validation errors occured, it shows error in different languages. Sometimes it uses correct locale but sometimes it shows with not the default locale but Request::getPreferredLanguage()

I don't know what causing it and how to I fix it. Log file shows anything, when dump the locales, everything seems just fine..

How can I solve this issue ?

0 likes
3 replies
bobbybouwmann's avatar

Are you sure the translations exists? That it's not using it as a fallback for the missing translations?

Apart from that I can't really see anything that is missing. Maybe you can share some more information about your setup?

1 like
hsntngr's avatar

@BOBBYBOUWMANN - Yes validation file exists in all languages and yes I'm using different fallback, actually that what makes everything weird. Even if there is something wrong, it should show errors with fallback language ..

Also I really don't know what should I share ? What could be helpful ?

bobbybouwmann's avatar

What kind of middleware do you use? How have you setup the language? Maybe you can share your repo on github?

Please or to participate in this conversation.