Sin descripción

sunhao fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
..
Catalogue fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Dumper fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Exception fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Extractor fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Loader fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Tests fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Writer fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
.gitignore fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
CHANGELOG.md fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
IdentityTranslator.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Interval.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
LICENSE fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
LoggingTranslator.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
MessageCatalogue.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
MessageCatalogueInterface.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
MessageSelector.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
MetadataAwareInterface.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
PluralizationRules.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
README.md fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
Translator.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
TranslatorBagInterface.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
TranslatorInterface.php fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
composer.json fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años
phpunit.xml.dist fe08a6fbcc 初始 %!s(int64=5) %!d(string=hace) años

README.md

Translation Component

Translation provides tools for loading translation files and generating translated strings from these including support for pluralization.

use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Loader\ArrayLoader;

$translator = new Translator('fr_FR', new MessageSelector());
$translator->setFallbackLocales(array('fr'));
$translator->addLoader('array', new ArrayLoader());
$translator->addResource('array', array(
    'Hello World!' => 'Bonjour',
), 'fr');

echo $translator->trans('Hello World!')."\n";

Resources

Silex integration:

https://github.com/fabpot/Silex/blob/master/src/Silex/Provider/TranslationServiceProvider.php

Documentation:

http://symfony.com/doc/2.6/book/translation.html

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/Translation/
$ composer.phar install
$ phpunit