Added $translator->addLoader()
For the example to work it needs the line with $translator->addLoader(). Fixed it for request at https://github.com/symfony/symfony/issues/39854#issuecomment-762283989
This commit is contained in:
parent
732bd84a8d
commit
ba29d2a2f0
@ -12,8 +12,10 @@ $ composer require symfony/translation
|
||||
|
||||
```php
|
||||
use Symfony\Component\Translation\Translator;
|
||||
use Symfony\Component\Translation\Loader\ArrayLoader;
|
||||
|
||||
$translator = new Translator('fr_FR');
|
||||
$translator->addLoader('array', new ArrayLoader());
|
||||
$translator->addResource('array', [
|
||||
'Hello World!' => 'Bonjour !',
|
||||
], 'fr_FR');
|
||||
|
Reference in New Issue
Block a user