You are here

public function Formatter::drupal_translation in Forena Reports 8

Parameters

$value:

$format_string:

\Drupal\forena\Token\ReportReplacer $teng:

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup|string

File

src/FrxPlugin/FieldFormatter/Formatter.php, line 64
contains various methods for extending report formating, layout, transformation and design.

Class

Formatter
Formatter for common drupal fields.

Namespace

Drupal\forena\FrxPlugin\FieldFormatter

Code

public function drupal_translation($value, $format_string, $teng) {
  $field = '';
  if ($format_string) {
    $field = '{' . $format_string . '}';
  }
  $field = $teng
    ->replace($field, TRUE);
  $vars = array();
  if ($field) {
    $vars = @unserialize($field);
    if (!$vars) {
      $vars = array();
    }
  }
  return t($value, $vars);
}