DrupalDateTime::$formatTranslationCache

Same name in other branches
  1. 9 core/lib/Drupal/Core/Datetime/DrupalDateTime.php \Drupal\Core\Datetime\DrupalDateTime::formatTranslationCache
  2. 10 core/lib/Drupal/Core/Datetime/DrupalDateTime.php \Drupal\Core\Datetime\DrupalDateTime::formatTranslationCache
  3. 11.x core/lib/Drupal/Core/Datetime/DrupalDateTime.php \Drupal\Core\Datetime\DrupalDateTime::formatTranslationCache

Formatted strings translation cache.

Translation cache represents an instance storage for formatted date strings. It contains a multidimensional array where:

  • first level keys - are drupal language codes;
  • second level keys - are each symbols of given format string (like 'F');
  • third level keys - are original matched strings related to the symbol;
  • values - are translated or not-translated original strings (depends on if a particular symbol represents translatable value according to PHP's date() format character).

For example:

[
    'en' => [
        'F' => [
            'November' => t('November'),
            'December' => t('December'),
        ],
        'd' => [
            '10' => '10',
            '31' => '31',
        ],
    ],
];

Type: array

File

core/lib/Drupal/Core/Datetime/DrupalDateTime.php, line 55

Class

DrupalDateTime
Extends DateTimePlus().

Namespace

Drupal\Core\Datetime

Code

protected $formatTranslationCache;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.