You are here

protected function DateRecurDefaultRRule::getString in Recurring Dates Field 8

2 calls to DateRecurDefaultRRule::getString()
DateRecurDefaultRRule::t in src/DateRecurDefaultRRule.php
DateRecurDefaultRRule::_hrFormatPosList in src/DateRecurDefaultRRule.php

File

src/DateRecurDefaultRRule.php, line 98

Class

DateRecurDefaultRRule

Namespace

Drupal\date_recur

Code

protected function getString($string) {

  /** @var TranslatableMarkup[] $strings */
  $strings = [
    'complete' => t('@rule at @time'),
    'and' => t('@a and @b'),
    'daily' => t('Every day'),
    'weekly' => t('Every week on @day'),
    'monthly' => t('On the @posday each month'),
    'pos_day' => t('@pos @day'),
    'last_1' => t('last'),
    'last_2' => t('second to last'),
  ];
  if (!empty($strings[$string])) {
    return $strings[$string]
      ->getUntranslatedString();
  }
  else {
    return '';
  }
}