You are here

private function LoggingTranslator::log in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/LoggingTranslator.php \Symfony\Component\Translation\LoggingTranslator::log()

Logs for missing translations.

Parameters

string $id:

string|null $domain:

string|null $locale:

2 calls to LoggingTranslator::log()
LoggingTranslator::trans in vendor/symfony/translation/LoggingTranslator.php
Translates the given message.
LoggingTranslator::transChoice in vendor/symfony/translation/LoggingTranslator.php
Translates the given choice message by choosing a translation according to a number.

File

vendor/symfony/translation/LoggingTranslator.php, line 106

Class

LoggingTranslator
@author Abdellatif Ait boudad <a.aitboudad@gmail.com>

Namespace

Symfony\Component\Translation

Code

private function log($id, $domain, $locale) {
  if (null === $domain) {
    $domain = 'messages';
  }
  $id = (string) $id;
  $catalogue = $this->translator
    ->getCatalogue($locale);
  if ($catalogue
    ->defines($id, $domain)) {
    return;
  }
  if ($catalogue
    ->has($id, $domain)) {
    $this->logger
      ->debug('Translation use fallback catalogue.', array(
      'id' => $id,
      'domain' => $domain,
      'locale' => $catalogue
        ->getLocale(),
    ));
  }
  else {
    $this->logger
      ->warning('Translation not found.', array(
      'id' => $id,
      'domain' => $domain,
      'locale' => $catalogue
        ->getLocale(),
    ));
  }
}