Skip to content

Commit 5b1a9cb

Browse files
committed
minor #35552 [Translation][Debug] Add installation and minimal example to README (wouterj)
This PR was squashed before being merged into the 3.4 branch (closes #35552). Discussion ---------- [Translation][Debug] Add installation and minimal example to README | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | - At SymfonyCon, we decided to test out removing some component documentation from the official docs. These were duplicating quite some information of the main guides and were confusing people that used the components in the framework. I think it's good to reintroduced the composer installation command and a very minimal example in the README's of the component. This doesn't require maintenance and can kickstart people to gain knowledge on how to use the component. For now, we've (re)moved the Debug and Translation component docs, so that's why I've only modified those README's. cc @symfony/team-symfony-docs Commits ------- b52b7b9 [Translation][Debug] Add installation and minimal example to README
2 parents ef4dcdb + b52b7b9 commit 5b1a9cb

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

src/Symfony/Component/Debug/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,22 @@ Debug Component
33

44
The Debug component provides tools to ease debugging PHP code.
55

6+
Getting Started
7+
---------------
8+
9+
```
10+
$ composer install symfony/debug
11+
```
12+
13+
```php
14+
use Symfony\Component\Debug\Debug;
15+
16+
Debug::enable();
17+
```
18+
619
Resources
720
---------
821

9-
* [Documentation](https://symfony.com/doc/current/components/debug.html)
1022
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
1123
* [Report issues](https://github.com/symfony/symfony/issues) and
1224
[send Pull Requests](https://github.com/symfony/symfony/pulls)

src/Symfony/Component/Translation/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,28 @@ Translation Component
33

44
The Translation component provides tools to internationalize your application.
55

6+
Getting Started
7+
---------------
8+
9+
```
10+
$ composer require symfony/translation
11+
```
12+
13+
```php
14+
use Symfony\Component\Translation\Translator;
15+
16+
$translator = new Translator('fr_FR');
17+
$translator->addResource('array', [
18+
'Hello World!' => 'Bonjour !',
19+
], 'fr_FR');
20+
21+
echo $translator->trans('Hello World!'); // outputs « Bonjour ! »
22+
```
23+
624
Resources
725
---------
826

9-
* [Documentation](https://symfony.com/doc/current/components/translation.html)
27+
* [Documentation](https://symfony.com/doc/current/translation.html)
1028
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
1129
* [Report issues](https://github.com/symfony/symfony/issues) and
1230
[send Pull Requests](https://github.com/symfony/symfony/pulls)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy