File tree Expand file tree Collapse file tree 1 file changed +6
-30
lines changed Expand file tree Collapse file tree 1 file changed +6
-30
lines changed Original file line number Diff line number Diff line change 1
1
Translation Component
2
2
=====================
3
3
4
- Translation provides tools for loading translation files and generating
5
- translated strings from these including support for pluralization.
6
-
7
- ``` php
8
- use Symfony\Component\Translation\Translator;
9
- use Symfony\Component\Translation\MessageSelector;
10
- use Symfony\Component\Translation\Loader\ArrayLoader;
11
-
12
- $translator = new Translator('fr_FR', new MessageSelector());
13
- $translator->setFallbackLocales(array('fr'));
14
- $translator->addLoader('array', new ArrayLoader());
15
- $translator->addResource('array', array(
16
- 'Hello World!' => 'Bonjour',
17
- ), 'fr');
18
-
19
- echo $translator->trans('Hello World!')."\n";
20
- ```
4
+ The Translation component provides tools to internationalize your application.
21
5
22
6
Resources
23
7
---------
24
8
25
- Silex integration:
26
-
27
- https://github.com/silexphp/Silex/blob/master/src/Silex/Provider/TranslationServiceProvider.php
28
-
29
- Documentation:
30
-
31
- https://symfony.com/doc/2.3/book/translation.html
32
-
33
- You can run the unit tests with the following command:
34
-
35
- $ cd path/to/Symfony/Component/Translation/
36
- $ composer install
37
- $ phpunit
9
+ * [ Documentation] ( https://symfony.com/doc/current/components/translation/index.html )
10
+ * [ Contributing] ( https://symfony.com/doc/current/contributing/index.html )
11
+ * [ Report issues] ( https://github.com/symfony/symfony/issues ) and
12
+ [ send Pull Requests] ( https://github.com/symfony/symfony/pulls )
13
+ in the [ main Symfony repository] ( https://github.com/symfony/symfony )
You can’t perform that action at this time.
0 commit comments