Skip to content

Commit

Permalink
Merge pull request #3250 from denis-gorin/issue-3249-image-fieldtype-…
Browse files Browse the repository at this point in the history
…localize

add isTranslatable condition in get method #3249
  • Loading branch information
bobdenotter authored Jun 21, 2022
2 parents 6b90d56 + b392c41 commit b847ffb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Entity/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ public function get($key)
return $this->getDefaultValue()->get($key);
}

return $this->translate($this->getCurrentLocale(), $this->useDefaultLocale())->get($key);
if ($this->isTranslatable()) {
return $this->translate($this->getCurrentLocale(), $this->useDefaultLocale())->get($key);
}

return $this->translate($this->getDefaultLocale(), false)->get($key);
}

/**
Expand Down

0 comments on commit b847ffb

Please sign in to comment.