Some issues with yii2-localeurls
justvladz opened this issue · 0 comments
justvladz commented
Hello, my friend!
Firstly, I want to say thank you for this component. This is a really great thing! Such functionality must be included into framework and work out of the box. But I tried to use it in 2021 and unfortunately got some issues with Yii2 2.0.41.
- You should use Yii::trace instead of Yii::debug, since 2.0.14 is deprecated.
- Yii::$app->session[$this->languageSessionKey] is @property-read.
- I had sometimes random problems with redirects until I disabled cache of urlManager by setting 'cache' => false.
- When you foreach ignoreLanguageUrlPatterns you should use break in your loop after the first url found.
- When I use ignoreLanguageUrlPatterns it blocks debug toolbar. Pattern '#^debug/#' => '#^debug#' solved it, but I think this is a bug.
- Using option ignoreLanguageUrlPatterns application doesn't catch language from session, only resets to default language. It is not very convenient when used for the authorized user panel, because each user has his own language.
It'd be great if you find time to refactor these moments. Have a good one!