View difference between Paste ID: wKKFnKdN and GZSdhXW3
SHOW: | | - or go back to the newest paste.
1
<?php
2
3
namespace Drupal\Core\Annotation;
4
5
/**
6
 * @Annotation
7
 */
8
class Translation {
9
  protected $translation;
10
11
  public function __construct($values) {
12
    $string = $values['value'];
13
    $options = array();
14
    if (!empty($values['context'])) {
15
      $options = array(
16
        'context' => $values['context'],
17
      );
18-
    else {
18+
19
    $this->translation = t($string, array(), $options);
20-
        'context' => 'plugin annotation',
20+
21
22
  public function getTranslation() {
23
    return $this->translation;
24
  }
25
}