Returns the value for the specified property in the given language.
\Drupal\Core\TypedData\TranslatableInterface $translation: The translation object the property value should be retrieved from.
string $property: The property name.
string $langcode: The property value.
The property value.
protected function getValue(ComplexDataInterface $translation, $property, $langcode) {
if ($translation instanceof EntityInterface && !$translation instanceof EntityNG) {
return is_array($translation->{$property}) ? $translation->{$property}[$langcode][0]['value'] : $translation->{$property};
}
else {
return $translation
->get($property)->value;
}
}