Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Drupal\Core\Annotation;
- /**
- * @Annotation
- */
- class Translation {
- protected $translation;
- public function __construct($values) {
- $string = $values['value'];
- $options = array();
- if (!empty($values['context'])) {
- $options = array(
- 'context' => $values['context'],
- );
- }
- $this->translation = t($string, array(), $options);
- }
- public function getTranslation() {
- return $this->translation;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment