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.     $options = array();
  14.     if (!empty($values['context'])) {
  15.       $options = array(
  16.         'context' => $values['context'],
  17.       );
  18.     }
  19.     $this->translation = t($string, array(), $options);
  20.   }
  21.  
  22.   public function getTranslation() {
  23.     return $this->translation;
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment