I use Yii v2.0.1 and encountered the following bug:
Suppose we have configured 2 languages: 'uk' and 'ru'. Default app lang is 'uk'.
I tried to get localized version in non-default lang like this:
$model = ModelClass::find()->localized('ru')->one();
echo $model->title; // It echoes title in default language, not 'ru'!
I found out that relational query condition value was ['and', ['language'=>'uk'], ['language'=>'ru']] that is, default app laguage (applied in MultilingualBehavior::getTranslation()) was and'd with scope's (MultilingualTrait::localized()) supplied parameter.
I use Yii v2.0.1 and encountered the following bug: Suppose we have configured 2 languages: 'uk' and 'ru'. Default app lang is 'uk'. I tried to get localized version in non-default lang like this:
I found out that relational query condition value was ['and', ['language'=>'uk'], ['language'=>'ru']] that is, default app laguage (applied in MultilingualBehavior::getTranslation()) was and'd with scope's (MultilingualTrait::localized()) supplied parameter.
Simple fix for this misbehavior attached.