symfony/symfony — Issue #2800: [Bug] Translation fails after xliff extension change
Author: jonathaningram
Created: 2011-12-08 00:14:33+00:00
State: open

```
An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in /vendor/symfony/src/Symfony/Component/Translation/Translator.php line 60")
```

In `Symfony\Bundle\FrameworkBundle\Translation\Translator::__construct`, `$loaderIds` is:

```
array(9) (
[translation.loader.php] => array(1) (
[0] => (string) php
)
[translation.loader.yml] => array(1) (
[0] => (string) yml
)
[translation.loader.xliff] => array(2) (
[0] => (string) xlf
[1] => (string) xliff
)
[translation.loader.po] => array(1) (
[0] => (string) po
)
[translation.loader.mo] => array(1) (
[0] => (string) mo
)
[translation.loader.qt] => array(1) (
[0] => (string) ts
)
[translation.loader.csv] => array(1) (
[0] => (string) csv
)
[translation.loader.rb] => array(1) (
[0] => (string) rb
)
[translation.loader.ini] => array(1) (
[0] => (string) ini
)
)
```

Then in my template, a simple `'x.x.x'|trans` eventually goes to `Symfony\Component\Translation\Translator::addLoader`:

```php
loaders[$format] = $loader;
}
```

With `$format`:

```
array(1) (
[0] => (string) php
)
```

Which obviously does not fit as an array offset into `$this->loaders`.
```