Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6c01479

Browse files
committed
minor #39895 [Translator] Added $translator->addLoader() to README example (Ser5)
This PR was merged into the 4.4 branch. Discussion ---------- [Translator] Added $translator->addLoader() to README example For the example to work it needs the line with $translator->addLoader(). Fixed it for request at #39854 (comment) | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch 5.x. --> Commits ------- ba29d2a Added $translator->addLoader()
2 parents 3257d4c + ba29d2a commit 6c01479

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/Translation/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ $ composer require symfony/translation
1212

1313
```php
1414
use Symfony\Component\Translation\Translator;
15+
use Symfony\Component\Translation\Loader\ArrayLoader;
1516

1617
$translator = new Translator('fr_FR');
18+
$translator->addLoader('array', new ArrayLoader());
1719
$translator->addResource('array', [
1820
'Hello World!' => 'Bonjour !',
1921
], 'fr_FR');

0 commit comments

Comments
 (0)