You are here

public function MessageCatalogue::has in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/MessageCatalogue.php \Symfony\Component\Translation\MessageCatalogue::has()

Checks if a message has a translation.

Parameters

string $id The message id:

string $domain The domain name:

Return value

bool true if the message has a translation, false otherwise

Overrides MessageCatalogueInterface::has

File

vendor/symfony/translation/MessageCatalogue.php, line 81

Class

MessageCatalogue
MessageCatalogue.

Namespace

Symfony\Component\Translation

Code

public function has($id, $domain = 'messages') {
  if (isset($this->messages[$domain][$id])) {
    return true;
  }
  if (null !== $this->fallbackCatalogue) {
    return $this->fallbackCatalogue
      ->has($id, $domain);
  }
  return false;
}