Browse Source

Frontend single language fix

master
Egorka 6 years ago
parent
commit
b6916b3e38
  1. 4
      core/components/LanguageDynamicModel.php

4
core/components/LanguageDynamicModel.php

@ -24,6 +24,10 @@ class LanguageDynamicModel extends DynamicModel
if ($entity) { if ($entity) {
foreach ($used_attributes as $used_attribute) { foreach ($used_attributes as $used_attribute) {
foreach ($entity->translations as $translate) { foreach ($entity->translations as $translate) {
if (!in_array($translate->language, $entity->translatedLanguages)) {
continue;
}
$defaultLanguage = basename(\Yii::$app->getBasePath()) === 'backend' $defaultLanguage = basename(\Yii::$app->getBasePath()) === 'backend'
? ?
Yii::$app->params['backendDefaultLanguage'] Yii::$app->params['backendDefaultLanguage']

Loading…
Cancel
Save