Skip to content

Commit

Permalink
[Translation][Debug] Add installation and minimal example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj authored and fabpot committed Feb 3, 2020
1 parent 577ec9b commit 0b95db6
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,28 @@ Translation Component

The Translation component provides tools to internationalize your application.

Getting Started
---------------

```
$ composer require symfony/translation
```

```php
use Symfony\Component\Translation\Translator;

$translator = new Translator('fr_FR');
$translator->addResource('array', [
'Hello World!' => 'Bonjour !',
], 'fr_FR');

echo $translator->trans('Hello World!'); // outputs « Bonjour ! »
```

Resources
---------

* [Documentation](https://symfony.com/doc/current/components/translation.html)
* [Documentation](https://symfony.com/doc/current/translation.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
Expand Down

0 comments on commit 0b95db6

Please sign in to comment.