symfony/symfony — Issue #2691: [translation] Fatal error: Maximum function nesting level of '500' reached, aborting!
Author: benboi
Created: 2011-11-22 15:39:34+00:00
State: open

When Im using the trans-filter within a twig-template im getting the following error, in case the word has no equivalent inside of a translation file:

Fatal error: Maximum function nesting level of '500' reached, aborting!

The problem seems to be inside of the Symfony\Component\Translation\MessageCatalogue class. I have found problems of the same kind inside of the issue-tracker already, but they have all been fixed.

The root of the problem is:

```php
/**
* {@inheritdoc}
*
* @api
*/
public function get($id, $domain = 'messages')
{
if (isset($this->messages[$domain][$id])) {
return $this->messages[$domain][$id];
}

if (null !== $this->fallbackCatalogue) {
return $this->fallbackCatalogue->get($id, $domain);
}

return $id;
}
```

The normal behaviour of the Translator should be returning the word i was using the filter on, if no record in the given language was found. Instead there is an infinite loop.

Fallback language and default_locale have been configured properly and are using different languages.

Any ideas?