EclipseGc

Untitled

Jul 12th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     if (!empty($values['context'])) {
  14.       $options = array(
  15.         'context' => $values['context'],
  16.       );
  17.     }
  18.     else {
  19.       $options = array(
  20.         'context' => 'plugin annotation',
  21.       );
  22.     }
  23.     $this->translation = t($string, array(), $options);
  24.   }
  25.  
  26.   public function getTranslation() {
  27.     return $this->translation;
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment