You are here

public function YamlDiscovery::addTranslatableProperty in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::addTranslatableProperty()

Set one of the YAML values as being translatable.

Parameters

string $value_key: The key corresponding to the value in the YAML that contains a translatable string.

string $context_key: (Optional) the translation context for the value specified by the $value_key.

Return value

$this

File

core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php, line 66

Class

YamlDiscovery
Allows YAML files to define plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function addTranslatableProperty($value_key, $context_key = '') {
  $this->translatableProperties[$value_key] = $context_key;
  return $this;
}