After installing this package my localization stopped working and I needed to move my lang folder from root to resources.
In Laravel 10 default location for lang is in root and should be good to keep it.
In the project I have a Serbian language and the localization name is sr_Latn but from your middleware, I see that you use only the first 2 characters I hack it temporarily but that's not good because in my case sr directory should be for Serbian Cyrillic and the sr_Latn for Serbian Latin which is commonly used