function YamlDiscovery::addTranslatableProperty

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::addTranslatableProperty()
  2. 10 core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::addTranslatableProperty()
  3. 11.x 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.