]> git.immae.eu Git - github/wallabag/wallabag.git/blame - vendor/symfony/translation/Symfony/Component/Translation/README.md
gitignore vendor
[github/wallabag/wallabag.git] / vendor / symfony / translation / Symfony / Component / Translation / README.md
CommitLineData
4f5b44bd
NL
1Translation Component
2=====================
3
4Translation provides tools for loading translation files and generating
5translated strings from these including support for pluralization.
6
7 use Symfony\Component\Translation\Translator;
8 use Symfony\Component\Translation\MessageSelector;
9 use Symfony\Component\Translation\Loader\ArrayLoader;
10
11 $translator = new Translator('fr_FR', new MessageSelector());
12 $translator->setFallbackLocales(array('fr'));
13 $translator->addLoader('array', new ArrayLoader());
14 $translator->addResource('array', array(
15 'Hello World!' => 'Bonjour',
16 ), 'fr');
17
18 echo $translator->trans('Hello World!')."\n";
19
20Resources
21---------
22
23Silex integration:
24
25https://github.com/fabpot/Silex/blob/master/src/Silex/Provider/TranslationServiceProvider.php
26
27Documentation:
28
29http://symfony.com/doc/2.3/book/translation.html
30
31You can run the unit tests with the following command:
32
33 $ cd path/to/Symfony/Component/Translation/
34 $ composer.phar install --dev
35 $ phpunit