diff --git a/core/composer.json b/core/composer.json index fba8153..452ad59 100644 --- a/core/composer.json +++ b/core/composer.json @@ -120,7 +120,8 @@ "drupal/update": "self.version", "drupal/user": "self.version", "drupal/views": "self.version", - "drupal/views_ui": "self.version" + "drupal/views_ui": "self.version", + "symfony/translation": "~2.4" }, "minimum-stability": "dev", "prefer-stable": true, @@ -128,7 +129,8 @@ "psr-4": { "Drupal\\Core\\": "lib/Drupal/Core", "Drupal\\Component\\": "lib/Drupal/Component", - "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver" + "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver", + "Symfony\\Component\\Translation\\": "lib/Symfony/Component/Translation" }, "files": [ "lib/Drupal.php" diff --git a/core/composer.lock b/core/composer.lock index b08e4d7..e1e7037 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e789e5736fbe96c9b9502e89b53dcebe", + "hash": "5916317ae84f5caeb1bb254f4fe65775", "packages": [ { "name": "behat/mink", @@ -2917,67 +2917,6 @@ "time": "2015-08-31 16:44:53" }, { - "name": "symfony/translation", - "version": "v2.7.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "485877661835e188cd78345c6d4eef1290d17571" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/485877661835e188cd78345c6d4eef1290d17571", - "reference": "485877661835e188cd78345c6d4eef1290d17571", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.4", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.2" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2015-09-06 08:36:38" - }, - { "name": "symfony/validator", "version": "v2.7.4", "source": { diff --git a/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php b/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php index 0372a0e..626f7d4 100644 --- a/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php +++ b/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php @@ -7,7 +7,7 @@ namespace Drupal\Core\TypedData\Validation; -use Symfony\Component\Translation\TranslatorInterface; +use Drupal\Core\Validation\TranslatorInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; @@ -68,7 +68,7 @@ class ConstraintViolationBuilder implements ConstraintViolationBuilderInterface /** * The translator. * - * @var \Symfony\Component\Translation\TranslatorInterface + * @var \Drupal\Core\Validation\TranslatorInterface */ protected $translator; @@ -117,7 +117,7 @@ class ConstraintViolationBuilder implements ConstraintViolationBuilderInterface * The property string. * @param mixed $invalidValue * The invalid value. - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param \Drupal\Core\Validation\TranslatorInterface $translator * The translator. * @param null $translationDomain * (optional) The translation domain. diff --git a/core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php b/core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php index da29f53..8dd518a 100644 --- a/core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php +++ b/core/lib/Drupal/Core/TypedData/Validation/ExecutionContext.php @@ -7,7 +7,7 @@ namespace Drupal\Core\TypedData\Validation; -use Symfony\Component\Translation\TranslatorInterface; +use Drupal\Core\Validation\TranslatorInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; @@ -38,7 +38,7 @@ class ExecutionContext implements ExecutionContextInterface { protected $root; /** - * @var \Symfony\Component\Translation\TranslatorInterface + * @var \Drupal\Core\Validation\TranslatorInterface */ protected $translator; @@ -117,7 +117,7 @@ class ExecutionContext implements ExecutionContextInterface { * The validator. * @param mixed $root * The root. - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param \Drupal\Core\Validation\TranslatorInterface $translator * The translator. * @param string $translationDomain * (optional) The translation domain. diff --git a/core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php b/core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php index be7c8d4..741af26 100644 --- a/core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php +++ b/core/lib/Drupal/Core/TypedData/Validation/ExecutionContextFactory.php @@ -7,7 +7,7 @@ namespace Drupal\Core\TypedData\Validation; -use Symfony\Component\Translation\TranslatorInterface; +use Drupal\Core\Validation\TranslatorInterface; use Symfony\Component\Validator\Context\ExecutionContextFactoryInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -21,7 +21,7 @@ class ExecutionContextFactory implements ExecutionContextFactoryInterface { /** - * @var TranslatorInterface + * @var \Drupal\Core\Validation\TranslatorInterface */ protected $translator; @@ -33,7 +33,7 @@ class ExecutionContextFactory implements ExecutionContextFactoryInterface { /** * Constructs a new ExecutionContextFactory instance. * - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param \Drupal\Core\Validation\TranslatorInterface $translator * The translator instance. * @param string $translationDomain * (optional) The translation domain. diff --git a/core/lib/Drupal/Core/Validation/DrupalTranslator.php b/core/lib/Drupal/Core/Validation/DrupalTranslator.php index b14c7d2..fea682b 100644 --- a/core/lib/Drupal/Core/Validation/DrupalTranslator.php +++ b/core/lib/Drupal/Core/Validation/DrupalTranslator.php @@ -7,8 +7,6 @@ namespace Drupal\Core\Validation; -use Symfony\Component\Translation\TranslatorInterface; - /** * Translates strings using Drupal's translation system. * diff --git a/core/lib/Drupal/Core/Validation/TranslationInterface.php b/core/lib/Drupal/Core/Validation/TranslationInterface.php new file mode 100644 index 0000000..341a2cf --- /dev/null +++ b/core/lib/Drupal/Core/Validation/TranslationInterface.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * TranslatorInterface. + * + * @author Fabien Potencier + * + * @api + */ +interface TranslatorInterface +{ + /** + * Translates the given message. + * + * @param string $id The message id (may also be an object that can be cast to string) + * @param array $parameters An array of parameters for the message + * @param string|null $domain The domain for the message or null to use the default + * @param string|null $locale The locale or null to use the default + * + * @throws \InvalidArgumentException If the locale contains invalid characters + * + * @return string The translated string + * + * @api + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null); + + /** + * Translates the given choice message by choosing a translation according to a number. + * + * @param string $id The message id (may also be an object that can be cast to string) + * @param int $number The number to use to find the indice of the message + * @param array $parameters An array of parameters for the message + * @param string|null $domain The domain for the message or null to use the default + * @param string|null $locale The locale or null to use the default + * + * @throws \InvalidArgumentException If the locale contains invalid characters + * + * @return string The translated string + * + * @api + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null); + + /** + * Sets the current locale. + * + * @param string $locale The locale + * + * @throws \InvalidArgumentException If the locale contains invalid characters + * + * @api + */ + public function setLocale($locale); + + /** + * Returns the current locale. + * + * @return string The locale + * + * @api + */ + public function getLocale(); +} diff --git a/core/vendor/composer/autoload_psr4.php b/core/vendor/composer/autoload_psr4.php index bd3969e..7fac11d 100644 --- a/core/vendor/composer/autoload_psr4.php +++ b/core/vendor/composer/autoload_psr4.php @@ -12,7 +12,7 @@ 'Zend\\Diactoros\\' => array($vendorDir . '/zendframework/zend-diactoros/src'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'), - 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), + 'Symfony\\Component\\Translation\\' => array($baseDir . '/lib/Symfony/Component/Translation'), 'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'), 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index c3755ed..8bc1933 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -3131,69 +3131,6 @@ "homepage": "https://symfony.com" }, { - "name": "symfony/translation", - "version": "v2.7.4", - "version_normalized": "2.7.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "485877661835e188cd78345c6d4eef1290d17571" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/485877661835e188cd78345c6d4eef1290d17571", - "reference": "485877661835e188cd78345c6d4eef1290d17571", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.4", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.2" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2015-09-06 08:36:38", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com" - }, - { "name": "symfony/validator", "version": "v2.7.4", "version_normalized": "2.7.4.0",