You are here

public function ParagraphsItemEntity::translatedInstanceLabel in Paragraphs 7

Returns the field instance label translated to interface language.

File

./ParagraphsItemEntity.inc, line 140

Class

ParagraphsItemEntity
Entity implementation for the paragraphs entity.

Code

public function translatedInstanceLabel($langcode = NULL) {
  if ($info = $this
    ->instanceInfo()) {
    if (module_exists('i18n_field')) {
      return i18n_string("field:{$this->field_name}:{$info['bundle']}:label", $info['label'], array(
        'langcode' => $langcode,
      ));
    }
    return $info['label'];
  }
}