From 46f751ccf258a6c4a4271c71b27c1fadf01668c4 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 27 Nov 2012 22:42:05 +0100 Subject: [PATCH 01/12] [Validator] Extracted message interpolation logic of ConstraintViolation and used the Translation component for that --- src/Symfony/Component/Validator/CHANGELOG.md | 2 + .../Validator/ConstraintViolation.php | 19 ++-- .../Component/Validator/DefaultTranslator.php | 57 ++++++++++ .../Component/Validator/ExecutionContext.php | 37 ++++++- .../Component/Validator/GraphWalker.php | 19 +++- .../Tests/ConstraintViolationListTest.php | 2 +- .../Tests/ConstraintViolationTest.php | 1 + .../Validator/Tests/ExecutionContextTest.php | 103 +++++++++++++++--- .../Validator/Tests/GraphWalkerTest.php | 11 +- .../Validator/Tests/ValidationVisitorTest.php | 16 ++- .../Validator/Tests/ValidatorBuilderTest.php | 16 ++- .../Validator/Tests/ValidatorContextTest.php | 3 +- .../Validator/Tests/ValidatorFactoryTest.php | 3 +- .../Validator/Tests/ValidatorTest.php | 14 ++- .../Component/Validator/ValidationVisitor.php | 21 +++- src/Symfony/Component/Validator/Validator.php | 26 ++++- .../Component/Validator/ValidatorBuilder.php | 34 +++++- .../Validator/ValidatorBuilderInterface.php | 23 ++++ .../Component/Validator/ValidatorContext.php | 3 +- src/Symfony/Component/Validator/composer.json | 3 +- 20 files changed, 364 insertions(+), 49 deletions(-) create mode 100644 src/Symfony/Component/Validator/DefaultTranslator.php diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index 20d499f855..b037079365 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -28,6 +28,8 @@ CHANGELOG As of Symfony 2.3, this method will be typed against `MetadataFactoryInterface` instead. * [BC BREAK] the switches `traverse` and `deep` in the `Valid` constraint and in `GraphWalker::walkReference` are ignored for arrays now. Arrays are always traversed recursively. + * added dependency to Translation component + * violation messages are now translated with a TranslatorInterface implementation 2.1.0 ----- diff --git a/src/Symfony/Component/Validator/ConstraintViolation.php b/src/Symfony/Component/Validator/ConstraintViolation.php index 7b6f1e1928..8f73d50c85 100644 --- a/src/Symfony/Component/Validator/ConstraintViolation.php +++ b/src/Symfony/Component/Validator/ConstraintViolation.php @@ -18,6 +18,11 @@ namespace Symfony\Component\Validator; */ class ConstraintViolation implements ConstraintViolationInterface { + /** + * @var string + */ + private $message; + /** * @var string */ @@ -56,6 +61,7 @@ class ConstraintViolation implements ConstraintViolationInterface /** * Creates a new constraint violation. * + * @param string $message The violation message. * @param string $messageTemplate The raw violation message. * @param array $messageParameters The parameters to substitute * in the raw message. @@ -70,8 +76,9 @@ class ConstraintViolation implements ConstraintViolationInterface * @param mixed $code The error code of the * violation, if any. */ - public function __construct($messageTemplate, array $messageParameters, $root, $propertyPath, $invalidValue, $messagePluralization = null, $code = null) + public function __construct($message, $messageTemplate, array $messageParameters, $root, $propertyPath, $invalidValue, $messagePluralization = null, $code = null) { + $this->message = $message; $this->messageTemplate = $messageTemplate; $this->messageParameters = $messageParameters; $this->messagePluralization = $messagePluralization; @@ -132,15 +139,7 @@ class ConstraintViolation implements ConstraintViolationInterface */ public function getMessage() { - $parameters = $this->messageParameters; - - foreach ($parameters as $i => $parameter) { - if (is_array($parameter)) { - $parameters[$i] = 'Array'; - } - } - - return strtr($this->messageTemplate, $parameters); + return $this->message; } /** diff --git a/src/Symfony/Component/Validator/DefaultTranslator.php b/src/Symfony/Component/Validator/DefaultTranslator.php new file mode 100644 index 0000000000..850e0f1e16 --- /dev/null +++ b/src/Symfony/Component/Validator/DefaultTranslator.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Symfony\Component\Translation\TranslatorInterface; + +/** + * Simple translator implementation that simply replaces the parameters in + * the message IDs. + * + * Does not support translation domains or locales. + * + * @author Bernhard Schussek + */ +class DefaultTranslator implements TranslatorInterface +{ + /** + * {@inheritdoc} + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null) + { + return strtr($id, $parameters); + } + + /** + * {@inheritdoc} + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + { + return strtr($id, $parameters); + } + + /** + * {@inheritdoc} + */ + public function setLocale($locale) + { + throw new \BadMethodCallException('Unsupported method.'); + } + + /** + * {@inheritdoc} + */ + public function getLocale() + { + throw new \BadMethodCallException('Unsupported method.'); + } +} diff --git a/src/Symfony/Component/Validator/ExecutionContext.php b/src/Symfony/Component/Validator/ExecutionContext.php index bfcaba891f..864f749da8 100644 --- a/src/Symfony/Component/Validator/ExecutionContext.php +++ b/src/Symfony/Component/Validator/ExecutionContext.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator; +use Symfony\Component\Translation\TranslatorInterface; + /** * Default implementation of {@link ExecutionContextInterface}. * @@ -26,6 +28,16 @@ class ExecutionContext implements ExecutionContextInterface */ private $globalContext; + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @var null|string + */ + private $translationDomain; + /** * @var MetadataInterface */ @@ -49,19 +61,23 @@ class ExecutionContext implements ExecutionContextInterface /** * Creates a new execution context. * - * @param GlobalExecutionContextInterface $globalContext The global context storing node-independent state. - * @param MetadataInterface $metadata The metadata of the validated node. - * @param mixed $value The value of the validated node. - * @param string $group The current validation group. - * @param string $propertyPath The property path to the current node. + * @param GlobalExecutionContextInterface $globalContext The global context storing node-independent state. + * @param TranslatorInterface $translator The translator for translating violation messages. + * @param null|string $translationDomain The domain of the validation messages. + * @param MetadataInterface $metadata The metadata of the validated node. + * @param mixed $value The value of the validated node. + * @param string $group The current validation group. + * @param string $propertyPath The property path to the current node. */ - public function __construct(GlobalExecutionContextInterface $globalContext, MetadataInterface $metadata = null, $value = null, $group = null, $propertyPath = '') + public function __construct(GlobalExecutionContextInterface $globalContext, TranslatorInterface $translator, $translationDomain = null, MetadataInterface $metadata = null, $value = null, $group = null, $propertyPath = '') { if (null === $group) { $group = Constraint::DEFAULT_GROUP; } $this->globalContext = $globalContext; + $this->translator = $translator; + $this->translationDomain = $translationDomain; $this->metadata = $metadata; $this->value = $value; $this->propertyPath = $propertyPath; @@ -74,6 +90,9 @@ class ExecutionContext implements ExecutionContextInterface public function addViolation($message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null) { $this->globalContext->getViolations()->add(new ConstraintViolation( + null === $pluralization + ? $this->translator->trans($message, $params, $this->translationDomain) + : $this->translator->transChoice($message, $pluralization, $params, $this->translationDomain), $message, $params, $this->globalContext->getRoot(), @@ -103,6 +122,9 @@ class ExecutionContext implements ExecutionContextInterface trigger_error('addViolationAtPath() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED); $this->globalContext->getViolations()->add(new ConstraintViolation( + null === $pluralization + ? $this->translator->trans($message, $params, $this->translationDomain) + : $this->translator->transChoice($message, $pluralization, $params, $this->translationDomain), $message, $params, $this->globalContext->getRoot(), @@ -146,6 +168,9 @@ class ExecutionContext implements ExecutionContextInterface public function addViolationAt($subPath, $message, array $params = array(), $invalidValue = null, $pluralization = null, $code = null) { $this->globalContext->getViolations()->add(new ConstraintViolation( + null === $pluralization + ? $this->translator->trans($message, $params, $this->translationDomain) + : $this->translator->transChoice($message, $pluralization, $params, $this->translationDomain), $message, $params, $this->globalContext->getRoot(), diff --git a/src/Symfony/Component/Validator/GraphWalker.php b/src/Symfony/Component/Validator/GraphWalker.php index 8af1a56153..ca212489a6 100644 --- a/src/Symfony/Component/Validator/GraphWalker.php +++ b/src/Symfony/Component/Validator/GraphWalker.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\MemberMetadata; @@ -39,6 +40,16 @@ class GraphWalker */ private $metadataFactory; + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @var null|string + */ + private $translationDomain; + /** * @var array */ @@ -49,16 +60,20 @@ class GraphWalker * * @param ValidationVisitor $visitor * @param MetadataFactoryInterface $metadataFactory + * @param TranslatorInterface $translator + * @param null|string $translationDomain * @param array $validatedObjects * * @deprecated Deprecated since version 2.2, to be removed in 2.3. */ - public function __construct(ValidationVisitor $visitor, MetadataFactoryInterface $metadataFactory, array &$validatedObjects = array()) + public function __construct(ValidationVisitor $visitor, MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, $translationDomain = null, array &$validatedObjects = array()) { trigger_error('GraphWalker is deprecated since version 2.2 and will be removed in 2.3. This class has been replaced by ValidationVisitorInterface and MetadataInterface.', E_USER_DEPRECATED); $this->visitor = $visitor; $this->metadataFactory = $metadataFactory; + $this->translator = $translator; + $this->translationDomain = $translationDomain; $this->validatedObjects = &$validatedObjects; } @@ -208,6 +223,8 @@ class GraphWalker $context = new ExecutionContext( $this->visitor, + $this->translator, + $this->translationDomain, $metadata, $value, $group, diff --git a/src/Symfony/Component/Validator/Tests/ConstraintViolationListTest.php b/src/Symfony/Component/Validator/Tests/ConstraintViolationListTest.php index f0d3e225a3..30d7ff0f64 100644 --- a/src/Symfony/Component/Validator/Tests/ConstraintViolationListTest.php +++ b/src/Symfony/Component/Validator/Tests/ConstraintViolationListTest.php @@ -129,6 +129,6 @@ EOF; protected function getViolation($message, $root = null, $propertyPath = null) { - return new ConstraintViolation($message, array(), $root, $propertyPath, null); + return new ConstraintViolation($message, $message, array(), $root, $propertyPath, null); } } diff --git a/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php b/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php index f4b3652468..e1f06c2428 100644 --- a/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php +++ b/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php @@ -18,6 +18,7 @@ class ConstraintViolationTest extends \PHPUnit_Framework_TestCase public function testToStringHandlesArrays() { $violation = new ConstraintViolation( + 'Array', '{{ value }}', array('{{ value }}' => array(1, 2, 3)), 'Root', diff --git a/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php b/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php index 40b5996646..467bdaaed7 100644 --- a/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php +++ b/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php @@ -19,11 +19,14 @@ use Symfony\Component\Validator\ExecutionContext; class ExecutionContextTest extends \PHPUnit_Framework_TestCase { + const TRANS_DOMAIN = 'trans_domain'; + private $visitor; private $violations; private $metadata; private $metadataFactory; private $globalContext; + private $translator; /** * @var ExecutionContext @@ -51,7 +54,8 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase $this->globalContext->expects($this->any()) ->method('getMetadataFactory') ->will($this->returnValue($this->metadataFactory)); - $this->context = new ExecutionContext($this->globalContext, $this->metadata, 'currentValue', 'Group', 'foo.bar'); + $this->translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $this->context = new ExecutionContext($this->globalContext, $this->translator, self::TRANS_DOMAIN, $this->metadata, 'currentValue', 'Group', 'foo.bar'); } protected function tearDown() @@ -82,7 +86,7 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase { // BC $this->metadata = new ClassMetadata(__NAMESPACE__ . '\ExecutionContextTest_TestClass'); - $this->context = new ExecutionContext($this->globalContext, $this->metadata, 'currentValue', 'Group', 'foo.bar'); + $this->context = new ExecutionContext($this->globalContext, $this->translator, self::TRANS_DOMAIN, $this->metadata, 'currentValue', 'Group', 'foo.bar'); $this->assertSame(__NAMESPACE__ . '\ExecutionContextTest_TestClass', $this->context->getCurrentClass()); $this->assertNull($this->context->getCurrentProperty()); @@ -92,7 +96,7 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase { // BC $this->metadata = new PropertyMetadata(__NAMESPACE__ . '\ExecutionContextTest_TestClass', 'myProperty'); - $this->context = new ExecutionContext($this->globalContext, $this->metadata, 'currentValue', 'Group', 'foo.bar'); + $this->context = new ExecutionContext($this->globalContext, $this->translator, self::TRANS_DOMAIN, $this->metadata, 'currentValue', 'Group', 'foo.bar'); $this->assertSame(__NAMESPACE__ . '\ExecutionContextTest_TestClass', $this->context->getCurrentClass()); $this->assertSame('myProperty', $this->context->getCurrentProperty()); @@ -111,10 +115,16 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolation() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + $this->context->addViolation('Error', array('foo' => 'bar'), 'invalid'); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array('foo' => 'bar'), 'Root', @@ -126,10 +136,16 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolationUsesPreconfiguredValueIfNotPassed() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array()) + ->will($this->returnValue('Translated error')); + $this->context->addViolation('Error'); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array(), 'Root', @@ -141,21 +157,32 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolationUsesPassedNullValue() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo1' => 'bar1')) + ->will($this->returnValue('Translated error')); + $this->translator->expects($this->once()) + ->method('transChoice') + ->with('Choice error', 1, array('foo2' => 'bar2')) + ->will($this->returnValue('Translated choice error')); + // passed null value should override preconfigured value "invalid" - $this->context->addViolation('Error', array('foo' => 'bar'), null); - $this->context->addViolation('Error', array('foo' => 'bar'), null, 1); + $this->context->addViolation('Error', array('foo1' => 'bar1'), null); + $this->context->addViolation('Choice error', array('foo2' => 'bar2'), null, 1); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', - array('foo' => 'bar'), + array('foo1' => 'bar1'), 'Root', 'foo.bar', null ), new ConstraintViolation( - 'Error', - array('foo' => 'bar'), + 'Translated choice error', + 'Choice error', + array('foo2' => 'bar2'), 'Root', 'foo.bar', null, @@ -166,11 +193,17 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolationAtPath() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + // override preconfigured property path $this->context->addViolationAtPath('bar.baz', 'Error', array('foo' => 'bar'), 'invalid'); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array('foo' => 'bar'), 'Root', @@ -182,10 +215,16 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolationAtPathUsesPreconfiguredValueIfNotPassed() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array()) + ->will($this->returnValue('Translated error')); + $this->context->addViolationAtPath('bar.baz', 'Error'); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array(), 'Root', @@ -197,12 +236,22 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolationAtPathUsesPassedNullValue() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + $this->translator->expects($this->once()) + ->method('transChoice') + ->with('Choice error', 3, array('foo' => 'bar')) + ->will($this->returnValue('Translated choice error')); + // passed null value should override preconfigured value "invalid" $this->context->addViolationAtPath('bar.baz', 'Error', array('foo' => 'bar'), null); - $this->context->addViolationAtPath('bar.baz', 'Error', array('foo' => 'bar'), null, 1); + $this->context->addViolationAtPath('bar.baz', 'Choice error', array('foo' => 'bar'), null, 3); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array('foo' => 'bar'), 'Root', @@ -210,23 +259,30 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase null ), new ConstraintViolation( - 'Error', + 'Translated choice error', + 'Choice error', array('foo' => 'bar'), 'Root', 'bar.baz', null, - 1 + 3 ), )), $this->context->getViolations()); } public function testAddViolationAt() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + // override preconfigured property path $this->context->addViolationAt('bam.baz', 'Error', array('foo' => 'bar'), 'invalid'); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array('foo' => 'bar'), 'Root', @@ -238,10 +294,16 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolationAtUsesPreconfiguredValueIfNotPassed() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array()) + ->will($this->returnValue('Translated error')); + $this->context->addViolationAt('bam.baz', 'Error'); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array(), 'Root', @@ -253,12 +315,22 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testAddViolationAtUsesPassedNullValue() { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + $this->translator->expects($this->once()) + ->method('transChoice') + ->with('Choice error', 2, array('foo' => 'bar')) + ->will($this->returnValue('Translated choice error')); + // passed null value should override preconfigured value "invalid" $this->context->addViolationAt('bam.baz', 'Error', array('foo' => 'bar'), null); - $this->context->addViolationAt('bam.baz', 'Error', array('foo' => 'bar'), null, 1); + $this->context->addViolationAt('bam.baz', 'Choice error', array('foo' => 'bar'), null, 2); $this->assertEquals(new ConstraintViolationList(array( new ConstraintViolation( + 'Translated error', 'Error', array('foo' => 'bar'), 'Root', @@ -266,12 +338,13 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase null ), new ConstraintViolation( - 'Error', + 'Translated choice error', + 'Choice error', array('foo' => 'bar'), 'Root', 'foo.bar.bam.baz', null, - 1 + 2 ), )), $this->context->getViolations()); } @@ -293,7 +366,7 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase public function testGetPropertyPathWithEmptyCurrentPropertyPath() { - $this->context = new ExecutionContext($this->globalContext, $this->metadata, 'currentValue', 'Group', ''); + $this->context = new ExecutionContext($this->globalContext, $this->translator, self::TRANS_DOMAIN, $this->metadata, 'currentValue', 'Group', ''); $this->assertEquals('bam.baz', $this->context->getPropertyPath('bam.baz')); } diff --git a/src/Symfony/Component/Validator/Tests/GraphWalkerTest.php b/src/Symfony/Component/Validator/Tests/GraphWalkerTest.php index 83a67db3cd..1f8d6213c0 100644 --- a/src/Symfony/Component/Validator/Tests/GraphWalkerTest.php +++ b/src/Symfony/Component/Validator/Tests/GraphWalkerTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Tests; use Symfony\Component\Validator\Tests\Fixtures\ConstraintAValidator; +use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\ValidationVisitor; use Symfony\Component\Validator\Tests\Fixtures\Entity; use Symfony\Component\Validator\Tests\Fixtures\Reference; @@ -53,7 +54,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->metadataFactory = new FakeMetadataFactory(); - $this->visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory()); + $this->visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator()); $this->walker = $this->visitor->getGraphWalker(); $this->metadata = new ClassMetadata(self::CLASSNAME); $this->metadataFactory->addMetadata($this->metadata); @@ -172,6 +173,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase // validated $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -204,6 +206,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase // "Default" was launched $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -231,6 +234,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase // Only group "Second" was validated $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -285,6 +289,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -317,6 +322,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -350,6 +356,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -449,6 +456,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -515,6 +523,7 @@ class GraphWalkerTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'message', 'message', array('param' => 'value'), 'Root', diff --git a/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php b/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php index 86fdbd5e95..1bbb33e26f 100644 --- a/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php @@ -14,6 +14,7 @@ namespace Symfony\Component\Validator\Tests; use Symfony\Component\Validator\Tests\Fixtures\FakeMetadataFactory; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\Tests\Fixtures\Reference; +use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\Tests\Fixtures\FailingConstraint; @@ -49,7 +50,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->metadataFactory = new FakeMetadataFactory(); - $this->visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory()); + $this->visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator()); $this->metadata = new ClassMetadata(self::CLASS_NAME); $this->metadataFactory->addMetadata($this->metadata); } @@ -154,6 +155,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase // validated $violations = new ConstraintViolationList(array( new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -187,6 +189,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase // "Default" was launched $violations = new ConstraintViolationList(array( new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -215,6 +218,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase // Only group "Second" was validated $violations = new ConstraintViolationList(array( new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -243,6 +247,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(array( // generated by the root object new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -251,6 +256,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase ), // generated by the reference new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -278,6 +284,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(array( // generated by the root object new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -286,6 +293,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase ), // generated by the reference new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -313,6 +321,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(array( // generated by the root object new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -321,6 +330,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase ), // generated by the reference new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -352,6 +362,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(array( // generated by the root object new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -414,6 +425,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(array( // generated by the root object new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -489,6 +501,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(array( // generated by the root object new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -497,6 +510,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase ), // nothing generated by the reference! new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', diff --git a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php index d963e4a848..d77d920704 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php @@ -96,8 +96,8 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase public function testSetMetadataCache() { - $this->assertSame($this->builder, $this->builder->setMetadataCache($this->getMock( - 'Symfony\Component\Validator\Mapping\Cache\CacheInterface')) + $this->assertSame($this->builder, $this->builder->setMetadataCache( + $this->getMock('Symfony\Component\Validator\Mapping\Cache\CacheInterface')) ); } @@ -107,4 +107,16 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase $this->getMock('Symfony\Component\Validator\ConstraintValidatorFactoryInterface')) ); } + + public function testSetTranslator() + { + $this->assertSame($this->builder, $this->builder->setTranslator( + $this->getMock('Symfony\Component\Translation\TranslatorInterface')) + ); + } + + public function testSetTranslationDomain() + { + $this->assertSame($this->builder, $this->builder->setTranslationDomain('TRANS_DOMAIN')); + } } diff --git a/src/Symfony/Component/Validator/Tests/ValidatorContextTest.php b/src/Symfony/Component/Validator/Tests/ValidatorContextTest.php index e10c2dad96..212a12cb47 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorContextTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorContextTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Tests; use Symfony\Component\Validator\Validator; +use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\Mapping\ClassMetadataFactoryAdapter; use Symfony\Component\Validator\ValidatorContext; @@ -57,6 +58,6 @@ class ValidatorContextTest extends \PHPUnit_Framework_TestCase ->setConstraintValidatorFactory($validatorFactory) ->getValidator(); - $this->assertEquals(new Validator(new ClassMetadataFactoryAdapter($metadataFactory), $validatorFactory), $validator); + $this->assertEquals(new Validator(new ClassMetadataFactoryAdapter($metadataFactory), $validatorFactory, new DefaultTranslator()), $validator); } } diff --git a/src/Symfony/Component/Validator/Tests/ValidatorFactoryTest.php b/src/Symfony/Component/Validator/Tests/ValidatorFactoryTest.php index 029678a8d4..8ab61cd581 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorFactoryTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorFactoryTest.php @@ -14,6 +14,7 @@ namespace Symfony\Component\Validator\Tests; use Doctrine\Common\Annotations\AnnotationReader; use Symfony\Component\Validator\Mapping\ClassMetadataFactoryAdapter; use Symfony\Component\Validator\Validator; +use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\ValidatorContext; use Symfony\Component\Validator\ValidatorFactory; use Symfony\Component\Validator\ConstraintValidatorFactory; @@ -78,7 +79,7 @@ class ValidatorFactoryTest extends \PHPUnit_Framework_TestCase $validator = $this->factory->getValidator(); - $this->assertEquals(new Validator(new ClassMetadataFactoryAdapter($metadataFactory), $validatorFactory), $validator); + $this->assertEquals(new Validator(new ClassMetadataFactoryAdapter($metadataFactory), $validatorFactory, new DefaultTranslator()), $validator); } public function testBuildDefaultFromAnnotationsWithCustomNamespaces() diff --git a/src/Symfony/Component/Validator/Tests/ValidatorTest.php b/src/Symfony/Component/Validator/Tests/ValidatorTest.php index a2fccc684a..4d184aee3f 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorTest.php @@ -16,6 +16,7 @@ use Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity; use Symfony\Component\Validator\Tests\Fixtures\FakeMetadataFactory; use Symfony\Component\Validator\Tests\Fixtures\FailingConstraint; use Symfony\Component\Validator\Validator; +use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\ConstraintValidatorFactory; @@ -37,7 +38,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->metadataFactory = new FakeMetadataFactory(); - $this->validator = new Validator($this->metadataFactory, new ConstraintValidatorFactory()); + $this->validator = new Validator($this->metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator()); } protected function tearDown() @@ -59,6 +60,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase // Only the constraint of group "Default" failed $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), $entity, @@ -82,6 +84,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase // Only the constraint of group "Custom" failed $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), $entity, @@ -107,6 +110,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase // The constraints of both groups failed $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), $entity, @@ -114,6 +118,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase '' )); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), $entity, @@ -141,6 +146,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), $entity, @@ -154,6 +160,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), $entity, @@ -198,6 +205,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase { $violations = new ConstraintViolationList(); $violations->add(new ConstraintViolation( + 'Failed', 'Failed', array(), '', @@ -232,7 +240,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase ->method('getMetadataFor') ->with('VALUE') ->will($this->returnValue($metadata)); - $this->validator = new Validator($this->metadataFactory, new ConstraintValidatorFactory()); + $this->validator = new Validator($this->metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator()); $this->validator->validateProperty('VALUE', 'someProperty'); } @@ -249,7 +257,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase ->method('getMetadataFor') ->with('VALUE') ->will($this->returnValue($metadata)); - $this->validator = new Validator($this->metadataFactory, new ConstraintValidatorFactory()); + $this->validator = new Validator($this->metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator()); $this->validator->validatePropertyValue('VALUE', 'someProperty', 'propertyValue'); } diff --git a/src/Symfony/Component/Validator/ValidationVisitor.php b/src/Symfony/Component/Validator/ValidationVisitor.php index 1ef231ed1c..ad21eff74a 100644 --- a/src/Symfony/Component/Validator/ValidationVisitor.php +++ b/src/Symfony/Component/Validator/ValidationVisitor.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Validator; use Symfony\Component\Validator\Exception\NoSuchMetadataException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Translation\TranslatorInterface; /** * Default implementation of {@link ValidationVisitorInterface} and @@ -37,6 +38,16 @@ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionCo */ private $validatorFactory; + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @var null|string + */ + private $translationDomain; + /** * @var array */ @@ -65,11 +76,13 @@ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionCo * @param mixed $root The value passed to the validator. * @param MetadataFactoryInterface $metadataFactory The factory for obtaining metadata instances. * @param ConstraintValidatorFactoryInterface $validatorFactory The factory for creating constraint validators. + * @param TranslatorInterface $translator The translator for translating violation messages. + * @param string|null $translationDomain The domain of the translation messages. * @param ObjectInitializerInterface[] $objectInitializers The initializers for preparing objects before validation. * * @throws UnexpectedTypeException If any of the object initializers is not an instance of ObjectInitializerInterface */ - public function __construct($root, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = array()) + public function __construct($root, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, TranslatorInterface $translator, $translationDomain = null, array $objectInitializers = array()) { foreach ($objectInitializers as $initializer) { if (!$initializer instanceof ObjectInitializerInterface) { @@ -80,6 +93,8 @@ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionCo $this->root = $root; $this->metadataFactory = $metadataFactory; $this->validatorFactory = $validatorFactory; + $this->translator = $translator; + $this->translationDomain = $translationDomain; $this->objectInitializers = $objectInitializers; $this->violations = new ConstraintViolationList(); } @@ -91,6 +106,8 @@ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionCo { $context = new ExecutionContext( $this, + $this->translator, + $this->translationDomain, $metadata, $value, $group, @@ -161,7 +178,7 @@ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionCo trigger_error('getGraphWalker() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED); if (null === $this->graphWalker) { - $this->graphWalker = new GraphWalker($this, $this->metadataFactory, $this->validatedObjects); + $this->graphWalker = new GraphWalker($this, $this->metadataFactory, $this->translator, $this->translationDomain, $this->validatedObjects); } return $this->graphWalker; diff --git a/src/Symfony/Component/Validator/Validator.php b/src/Symfony/Component/Validator/Validator.php index 848dc4e2ed..a700692d8d 100644 --- a/src/Symfony/Component/Validator/Validator.php +++ b/src/Symfony/Component/Validator/Validator.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Validator; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\Exception\ValidatorException; +use Symfony\Component\Translation\TranslatorInterface; /** * Default implementation of {@link ValidatorInterface}. @@ -32,6 +33,16 @@ class Validator implements ValidatorInterface */ private $validatorFactory; + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @var null|string + */ + private $translationDomain; + /** * @var array */ @@ -40,11 +51,15 @@ class Validator implements ValidatorInterface public function __construct( MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, + TranslatorInterface $translator, + $translationDomain = null, array $objectInitializers = array() ) { $this->metadataFactory = $metadataFactory; $this->validatorFactory = $validatorFactory; + $this->translator = $translator; + $this->translationDomain = $translationDomain; $this->objectInitializers = $objectInitializers; } @@ -137,7 +152,7 @@ class Validator implements ValidatorInterface */ public function validateValue($value, $constraints, $groups = null) { - $context = new ExecutionContext($this->createVisitor(null)); + $context = new ExecutionContext($this->createVisitor(null), $this->translator, $this->translationDomain); $constraints = is_array($constraints) ? $constraints : array($constraints); @@ -176,7 +191,14 @@ class Validator implements ValidatorInterface */ private function createVisitor($root) { - return new ValidationVisitor($root, $this->metadataFactory, $this->validatorFactory, $this->objectInitializers); + return new ValidationVisitor( + $root, + $this->metadataFactory, + $this->validatorFactory, + $this->translator, + $this->translationDomain, + $this->objectInitializers + ); } /** diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index 8f39d4ae4d..8937042d44 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -23,6 +23,7 @@ use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader; use Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader; use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader; use Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader; +use Symfony\Component\Translation\TranslatorInterface; use Doctrine\Common\Annotations\Reader; use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\CachedReader; @@ -75,6 +76,16 @@ class ValidatorBuilder implements ValidatorBuilderInterface */ private $metadataCache; + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @var null|string + */ + private $translationDomain; + /** * {@inheritdoc} */ @@ -254,6 +265,26 @@ class ValidatorBuilder implements ValidatorBuilderInterface return $this; } + /** + * {@inheritdoc} + */ + public function setTranslator(TranslatorInterface $translator) + { + $this->translator = $translator; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setTranslationDomain($translationDomain) + { + $this->translationDomain = $translationDomain; + + return $this; + } + /** * {@inheritdoc} */ @@ -296,7 +327,8 @@ class ValidatorBuilder implements ValidatorBuilderInterface } $validatorFactory = $this->validatorFactory ?: new ConstraintValidatorFactory(); + $translator = $this->translator ?: new DefaultTranslator(); - return new Validator($metadataFactory, $validatorFactory, $this->initializers); + return new Validator($metadataFactory, $validatorFactory, $translator, $this->translationDomain, $this->initializers); } } diff --git a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php index 914d4f96d7..18b96eac36 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php +++ b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator; use Symfony\Component\Validator\Mapping\Cache\CacheInterface; +use Symfony\Component\Translation\TranslatorInterface; use Doctrine\Common\Annotations\Reader; /** @@ -139,6 +140,28 @@ interface ValidatorBuilderInterface */ public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory); + /** + * Sets the translator used for translating violation messages. + * + * @param TranslatorInterface $translator The translator instance. + * + * @return ValidatorBuilderInterface The builder object. + */ + public function setTranslator(TranslatorInterface $translator); + + /** + * Sets the default translation domain of violation messages. + * + * The same message can have different translations in different domains. + * Pass the domain that is used for violation messages by default to this + * method. + * + * @param string $translationDomain The translation domain of the violation messages. + * + * @return ValidatorBuilderInterface The builder object. + */ + public function setTranslationDomain($translationDomain); + /** * Builds and returns a new validator object. * diff --git a/src/Symfony/Component/Validator/ValidatorContext.php b/src/Symfony/Component/Validator/ValidatorContext.php index 9c8ec3d043..c5e9f34e0d 100644 --- a/src/Symfony/Component/Validator/ValidatorContext.php +++ b/src/Symfony/Component/Validator/ValidatorContext.php @@ -89,7 +89,8 @@ class ValidatorContext implements ValidatorContextInterface return new Validator( $this->metadataFactory, - $this->constraintValidatorFactory + $this->constraintValidatorFactory, + new DefaultTranslator() ); } diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index e3cb106914..9c65253c8e 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -16,7 +16,8 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/translation": "2.2.*" }, "require-dev": { "symfony/http-foundation": "2.2.*", From e7eb5b0d7dd57f6a9cddf92b05c697d849376cbd Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 27 Nov 2012 23:17:30 +0100 Subject: [PATCH 02/12] [Form] Adapted Form component to translator integration in the validator --- .../ViolationMapper/ViolationMapper.php | 1 + src/Symfony/Component/Form/FormError.php | 18 +++++++++++++----- .../Form/Tests/AbstractDivLayoutTest.php | 6 +++--- .../Form/Tests/AbstractLayoutTest.php | 8 ++++---- .../Form/Tests/AbstractTableLayoutTest.php | 6 +++--- .../EventListener/ValidationListenerTest.php | 10 ++++------ .../ViolationMapper/ViolationMapperTest.php | 10 ++++++++-- 7 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php index 9ac6bb69b3..cece98804e 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php @@ -123,6 +123,7 @@ class ViolationMapper implements ViolationMapperInterface // Only add the error if the form is synchronized if ($this->acceptsErrors($scope)) { $scope->addError(new FormError( + $violation->getMessage(), $violation->getMessageTemplate(), $violation->getMessageParameters(), $violation->getMessagePluralization() diff --git a/src/Symfony/Component/Form/FormError.php b/src/Symfony/Component/Form/FormError.php index b336a40388..343165ca46 100644 --- a/src/Symfony/Component/Form/FormError.php +++ b/src/Symfony/Component/Form/FormError.php @@ -18,6 +18,11 @@ namespace Symfony\Component\Form; */ class FormError { + /** + * @var string + */ + private $message; + /** * The template for the error message * @var string @@ -41,16 +46,19 @@ class FormError * * Any array key in $messageParameters will be used as a placeholder in * $messageTemplate. - * @see \Symfony\Component\Translation\Translator * - * @param string $messageTemplate The template for the error message + * @param string $message The translated error message + * @param string|null $messageTemplate The template for the error message * @param array $messageParameters The parameters that should be * substituted in the message template. * @param integer|null $messagePluralization The value for error message pluralization + * + * @see \Symfony\Component\Translation\Translator */ - public function __construct($messageTemplate, array $messageParameters = array(), $messagePluralization = null) + public function __construct($message, $messageTemplate = null, array $messageParameters = array(), $messagePluralization = null) { - $this->messageTemplate = $messageTemplate; + $this->message = $message; + $this->messageTemplate = $messageTemplate ?: $message; $this->messageParameters = $messageParameters; $this->messagePluralization = $messagePluralization; } @@ -62,7 +70,7 @@ class FormError */ public function getMessage() { - return strtr($this->messageTemplate, $this->messageParameters); + return $this->message; } /** diff --git a/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php index ac9b18b065..7fd743006e 100644 --- a/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php @@ -19,7 +19,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest public function testRow() { $form = $this->factory->createNamed('name', 'text'); - $form->addError(new FormError('Error!')); + $form->addError(new FormError('[trans]Error![/trans]')); $view = $form->createView(); $html = $this->renderRow($view); @@ -58,7 +58,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest public function testRepeatedRow() { $form = $this->factory->createNamed('name', 'repeated'); - $form->addError(new FormError('Error!')); + $form->addError(new FormError('[trans]Error![/trans]')); $view = $form->createView(); $html = $this->renderRow($view); @@ -398,7 +398,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest ) ->getForm(); - $form->get('child')->addError(new FormError('Error!')); + $form->get('child')->addError(new FormError('[trans]Error![/trans]')); $this->assertWidgetMatchesXpath($form->createView(), array(), '/div diff --git a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php index a7ff80e9de..e2801c2d8e 100644 --- a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php @@ -283,8 +283,8 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase public function testErrors() { $form = $this->factory->createNamed('name', 'text'); - $form->addError(new FormError('Error 1')); - $form->addError(new FormError('Error 2')); + $form->addError(new FormError('[trans]Error 1[/trans]')); + $form->addError(new FormError('[trans]Error 2[/trans]')); $view = $form->createView(); $html = $this->renderErrors($view); @@ -1151,7 +1151,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase { $child = $this->factory->createNamed('date', 'date'); $form = $this->factory->createNamed('form', 'form')->add($child); - $child->addError(new FormError('Error!')); + $child->addError(new FormError('[trans]Error![/trans]')); $view = $form->createView(); $this->assertEmpty($this->renderErrors($view)); @@ -1676,7 +1676,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase { $child = $this->factory->createNamed('time', 'time'); $form = $this->factory->createNamed('form', 'form')->add($child); - $child->addError(new FormError('Error!')); + $child->addError(new FormError('[trans]Error![/trans]')); $view = $form->createView(); $this->assertEmpty($this->renderErrors($view)); diff --git a/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php index efa957fb0b..e0f62c4ab1 100644 --- a/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php @@ -18,7 +18,7 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest public function testRow() { $form = $this->factory->createNamed('name', 'text'); - $form->addError(new FormError('Error!')); + $form->addError(new FormError('[trans]Error![/trans]')); $view = $form->createView(); $html = $this->renderRow($view); @@ -91,7 +91,7 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest public function testRepeatedRowWithErrors() { $form = $this->factory->createNamed('name', 'repeated'); - $form->addError(new FormError('Error!')); + $form->addError(new FormError('[trans]Error![/trans]')); $view = $form->createView(); $html = $this->renderRow($view); @@ -250,7 +250,7 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest ) ->getForm(); - $form->get('child')->addError(new FormError('Error!')); + $form->get('child')->addError(new FormError('[trans]Error![/trans]')); $this->assertWidgetMatchesXpath($form->createView(), array(), '/table diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php index 7e358910e2..d9555e13e1 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php @@ -49,6 +49,8 @@ class ValidationListenerTest extends \PHPUnit_Framework_TestCase private $message; + private $messageTemplate; + private $params; protected function setUp() @@ -63,17 +65,13 @@ class ValidationListenerTest extends \PHPUnit_Framework_TestCase $this->violationMapper = $this->getMock('Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapperInterface'); $this->listener = new ValidationListener($this->validator, $this->violationMapper); $this->message = 'Message'; + $this->messageTemplate = 'Message template'; $this->params = array('foo' => 'bar'); } private function getConstraintViolation($code = null) { - return new ConstraintViolation($this->message, $this->params, null, 'prop.path', null, null, $code); - } - - private function getFormError() - { - return new FormError($this->message, $this->params); + return new ConstraintViolation($this->message, $this->messageTemplate, $this->params, null, 'prop.path', null, null, $code); } private function getBuilder($name = 'name', $propertyPath = null, $dataClass = null) diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php index e192f07108..2f41a99101 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php @@ -48,6 +48,11 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase */ private $message; + /** + * @var string + */ + private $messageTemplate; + /** * @var array */ @@ -62,6 +67,7 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->mapper = new ViolationMapper(); $this->message = 'Message'; + $this->messageTemplate = 'Message template'; $this->params = array('foo' => 'bar'); } @@ -101,7 +107,7 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase */ protected function getConstraintViolation($propertyPath) { - return new ConstraintViolation($this->message, $this->params, null, $propertyPath, null); + return new ConstraintViolation($this->message, $this->messageTemplate, $this->params, null, $propertyPath, null); } /** @@ -109,7 +115,7 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase */ protected function getFormError() { - return new FormError($this->message, $this->params); + return new FormError($this->message, $this->messageTemplate, $this->params); } public function testMapToVirtualFormIfDataDoesNotMatch() From 92a3b27a70cca04d6f834a518ce5f0cba2ea1bca Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 27 Nov 2012 23:17:49 +0100 Subject: [PATCH 03/12] [TwigBridge] Adapted TwigBridge to translator integration in the validator --- .../Twig/Resources/views/Form/form_div_layout.html.twig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig index d7be0986a9..870cdd99dd 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig @@ -275,11 +275,7 @@ {% if errors|length > 0 %}
    {% for error in errors %} -
  • {{ - error.messagePluralization is null - ? error.messageTemplate|trans(error.messageParameters, 'validators') - : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') - }}
  • +
  • {{ error.message }}
  • {% endfor %}
{% endif %} From c96a0511f221669e809e4d7d22902b1828ab5c06 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 27 Nov 2012 23:18:12 +0100 Subject: [PATCH 04/12] [FrameworkBundle] Adapted FrameworkBundle to translator integration in the validator --- .../Compiler/AddValidatorInitializersPass.php | 2 +- .../DependencyInjection/Configuration.php | 1 + .../FrameworkExtension.php | 1 + .../Resources/config/validator.xml | 2 ++ .../Resources/views/Form/form_errors.html.php | 16 +------------- .../views/FormTable/form_errors.html.php | 21 ------------------- 6 files changed, 6 insertions(+), 37 deletions(-) delete mode 100644 src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php index 6f3be9b2a5..bf9f338111 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddValidatorInitializersPass.php @@ -28,6 +28,6 @@ class AddValidatorInitializersPass implements CompilerPassInterface $initializers[] = new Reference($id); } - $container->getDefinition('validator')->replaceArgument(2, $initializers); + $container->getDefinition('validator')->replaceArgument(4, $initializers); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 60caf1d00c..70017d727b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -370,6 +370,7 @@ class Configuration implements ConfigurationInterface ->children() ->scalarNode('cache')->end() ->booleanNode('enable_annotations')->defaultFalse()->end() + ->scalarNode('translation_domain')->defaultValue('validators')->end() ->end() ->end() ->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 1ec5e9e2ae..baeb0abba8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -574,6 +574,7 @@ class FrameworkExtension extends Extension { $loader->load('validator.xml'); + $container->setParameter('validator.translation_domain', $config['translation_domain']); $container->setParameter('validator.mapping.loader.xml_files_loader.mapping_files', $this->getValidatorXmlMappingFiles($container)); $container->setParameter('validator.mapping.loader.yaml_files_loader.mapping_files', $this->getValidatorYamlMappingFiles($container)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml index 2dad8ca211..0bc70040a2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml @@ -23,6 +23,8 @@ + + %validator.translation_domain% diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php index 339e3d0009..da9bec42ec 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_errors.html.php @@ -1,21 +1,7 @@
    -
  • getMessagePluralization()) { - echo $view['translator']->trans( - $error->getMessageTemplate(), - $error->getMessageParameters(), - 'validators' - ); - } else { - echo $view['translator']->transChoice( - $error->getMessageTemplate(), - $error->getMessagePluralization(), - $error->getMessageParameters(), - 'validators' - ); - }?>
  • +
  • getMessage() ?>
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php deleted file mode 100644 index 339e3d0009..0000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_errors.html.php +++ /dev/null @@ -1,21 +0,0 @@ - -
    - -
  • getMessagePluralization()) { - echo $view['translator']->trans( - $error->getMessageTemplate(), - $error->getMessageParameters(), - 'validators' - ); - } else { - echo $view['translator']->transChoice( - $error->getMessageTemplate(), - $error->getMessagePluralization(), - $error->getMessageParameters(), - 'validators' - ); - }?>
  • - -
- From b94a256cc75a116566f70cbfde8eb760f225fbeb Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 27 Nov 2012 23:23:26 +0100 Subject: [PATCH 05/12] [DoctrineBridge] Adapted DoctrineBridge to translator integration in the validator --- .../Tests/Validator/Constraints/UniqueValidatorTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php index efa077a63c..db80925111 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php @@ -12,6 +12,7 @@ namespace Symfony\Bridge\Doctrine\Tests\Validator\Constraints; use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; +use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\Tests\Fixtures\FakeMetadataFactory; use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity; use Symfony\Bridge\Doctrine\Tests\Fixtures\DoubleIdentEntity; @@ -132,7 +133,7 @@ class UniqueValidatorTest extends DoctrineOrmTestCase $metadataFactory->addMetadata($metadata); $validatorFactory = $this->createValidatorFactory($uniqueValidator); - return new Validator($metadataFactory, $validatorFactory); + return new Validator($metadataFactory, $validatorFactory, new DefaultTranslator()); } private function createSchema($em) From 1e34e91909d6c8de9543011b4f0416d9449fb4d5 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 27 Nov 2012 23:24:28 +0100 Subject: [PATCH 06/12] [Form] Added upgrade instructions to the UPGRADE file --- UPGRADE-2.2.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/UPGRADE-2.2.md b/UPGRADE-2.2.md index a14fdda35b..f8ff48cdd0 100644 --- a/UPGRADE-2.2.md +++ b/UPGRADE-2.2.md @@ -64,6 +64,26 @@ Symfony\Component\Form\Exception namespace or to create custom exception classes for your purpose. + * Translating validation errors is now optional. You can still do so + manually if you like, or you can simplify your templates to simply output + the already translated message. + + Before: + + ``` + {{ + error.messagePluralization is null + ? error.messageTemplate|trans(error.messageParameters, 'validators') + : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') + }} + ``` + + After: + + ``` + {{ error.message }} + ``` + #### Deprecations * The methods `getParent()`, `setParent()` and `hasParent()` in From 56d61eb6da5ee9859129fee756ecc046c95d636a Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Wed, 28 Nov 2012 14:07:07 +0100 Subject: [PATCH 07/12] [Form][Validator] Added BC breaks in unstable code to the CHANGELOG --- src/Symfony/Component/Form/CHANGELOG.md | 1 + src/Symfony/Component/Validator/CHANGELOG.md | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Symfony/Component/Form/CHANGELOG.md b/src/Symfony/Component/Form/CHANGELOG.md index c229302a5e..d8e309637f 100644 --- a/src/Symfony/Component/Form/CHANGELOG.md +++ b/src/Symfony/Component/Form/CHANGELOG.md @@ -12,6 +12,7 @@ CHANGELOG * deprecated FormException and introduced ExceptionInterface instead * [BC BREAK] FormException is now an interface * protected FormBuilder methods from being called when it is turned into a FormConfigInterface with getFormConfig() + * [BC BREAK] inserted argument `$message` in the constructor of `FormError` 2.1.0 ----- diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index b037079365..79416e59e6 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -30,6 +30,12 @@ CHANGELOG are ignored for arrays now. Arrays are always traversed recursively. * added dependency to Translation component * violation messages are now translated with a TranslatorInterface implementation + * [BC BREAK] inserted argument `$message` in the constructor of `ConstraintViolation` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `ExecutionContext` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `GraphWalker` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `ValidationVisitor` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `Validator` + * [BC BREAK] added `setTranslator()` and `setTranslationDomain()` to `ValidatorBuilderInterface` 2.1.0 ----- From cc0df0a5aff1f5362373db951fd9d8b5fddc7de8 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Mon, 3 Dec 2012 16:49:07 +0100 Subject: [PATCH 08/12] [Validator] Changed validator to support pluralized messages by default This was implemented in order to satisfy Drupal's requirements for a singular and a plural message whenever a message is passed to their implementation of transChoice(). --- UPGRADE-2.2.md | 21 ++++++++++ src/Symfony/Component/Validator/CHANGELOG.md | 2 + .../Validator/Constraints/Choice.php | 4 +- .../Component/Validator/Constraints/Count.php | 6 +-- .../Validator/Constraints/Length.php | 6 +-- .../Validator/Constraints/MaxLength.php | 2 +- .../Validator/Constraints/MinLength.php | 2 +- .../Component/Validator/DefaultTranslator.php | 12 +++++- .../Resources/translations/validators.af.xlf | 16 +++---- .../Resources/translations/validators.bg.xlf | 18 ++++---- .../Resources/translations/validators.ca.xlf | 16 +++---- .../Resources/translations/validators.cs.xlf | 16 +++---- .../Resources/translations/validators.cy.xlf | 42 +++++++++---------- .../Resources/translations/validators.da.xlf | 10 ++--- .../Resources/translations/validators.de.xlf | 16 +++---- .../Resources/translations/validators.en.xlf | 16 +++---- .../Resources/translations/validators.es.xlf | 16 +++---- .../Resources/translations/validators.et.xlf | 8 ++-- .../Resources/translations/validators.eu.xlf | 16 +++---- .../Resources/translations/validators.fa.xlf | 16 +++---- .../Resources/translations/validators.fi.xlf | 16 +++---- .../Resources/translations/validators.fr.xlf | 16 +++---- .../Resources/translations/validators.gl.xlf | 16 +++---- .../Resources/translations/validators.he.xlf | 16 +++---- .../Resources/translations/validators.hr.xlf | 10 ++--- .../Resources/translations/validators.hu.xlf | 16 +++---- .../Resources/translations/validators.hy.xlf | 12 +++--- .../Resources/translations/validators.id.xlf | 16 +++---- .../Resources/translations/validators.it.xlf | 16 +++---- .../Resources/translations/validators.ja.xlf | 8 ++-- .../Resources/translations/validators.lb.xlf | 16 +++---- .../Resources/translations/validators.lt.xlf | 16 +++---- .../Resources/translations/validators.mn.xlf | 8 ++-- .../Resources/translations/validators.nb.xlf | 8 ++-- .../Resources/translations/validators.nl.xlf | 16 +++---- .../Resources/translations/validators.no.xlf | 18 ++++---- .../Resources/translations/validators.pl.xlf | 16 +++---- .../Resources/translations/validators.pt.xlf | 16 +++---- .../translations/validators.pt_BR.xlf | 16 +++---- .../Resources/translations/validators.ro.xlf | 16 +++---- .../Resources/translations/validators.ru.xlf | 16 +++---- .../Resources/translations/validators.sk.xlf | 16 +++---- .../Resources/translations/validators.sl.xlf | 16 +++---- .../Resources/translations/validators.sq.xlf | 16 +++---- .../translations/validators.sr_Cyrl.xlf | 16 +++---- .../translations/validators.sr_Latn.xlf | 16 +++---- .../Resources/translations/validators.sv.xlf | 18 ++++---- .../Resources/translations/validators.tr.xlf | 16 +++---- .../Resources/translations/validators.uk.xlf | 18 ++++---- .../translations/validators.zh_CN.xlf | 16 +++---- 50 files changed, 373 insertions(+), 340 deletions(-) diff --git a/UPGRADE-2.2.md b/UPGRADE-2.2.md index f8ff48cdd0..c485bf6112 100644 --- a/UPGRADE-2.2.md +++ b/UPGRADE-2.2.md @@ -206,6 +206,27 @@ } ``` + * The sources of the pluralized messages in translation files have changed + from the singular to the pluralized version. If you created custom + translation files for validator errors, you should adapt them. + + Before: + + + You must select at least {{ limit }} choices. + Sie müssen mindestens {{ limit }} Möglichkeit wählen.|Sie müssen mindestens {{ limit }} Möglichkeiten wählen. + + + After: + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Sie müssen mindestens {{ limit }} Möglichkeit wählen.|Sie müssen mindestens {{ limit }} Möglichkeiten wählen. + + + Check the file src/Symfony/Component/Validator/Resources/translations/validators.en.xlf + for the new message sources. + #### Deprecations * The interface `ClassMetadataFactoryInterface` was deprecated and will be diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index 79416e59e6..b0f47b233b 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -36,6 +36,8 @@ CHANGELOG * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `ValidationVisitor` * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `Validator` * [BC BREAK] added `setTranslator()` and `setTranslationDomain()` to `ValidatorBuilderInterface` + * improved the Validator to support pluralized messages by default + * [BC BREAK] changed the source of all pluralized messages in the translation files to the pluralized version 2.1.0 ----- diff --git a/src/Symfony/Component/Validator/Constraints/Choice.php b/src/Symfony/Component/Validator/Constraints/Choice.php index b73bd77ca3..70d6fd4da9 100644 --- a/src/Symfony/Component/Validator/Constraints/Choice.php +++ b/src/Symfony/Component/Validator/Constraints/Choice.php @@ -28,8 +28,8 @@ class Choice extends Constraint public $max = null; public $message = 'The value you selected is not a valid choice.'; public $multipleMessage = 'One or more of the given values is invalid.'; - public $minMessage = 'You must select at least {{ limit }} choices.'; - public $maxMessage = 'You must select at most {{ limit }} choices.'; + public $minMessage = 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.'; + public $maxMessage = 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.'; /** * {@inheritDoc} diff --git a/src/Symfony/Component/Validator/Constraints/Count.php b/src/Symfony/Component/Validator/Constraints/Count.php index db0661d0d1..afb0089282 100644 --- a/src/Symfony/Component/Validator/Constraints/Count.php +++ b/src/Symfony/Component/Validator/Constraints/Count.php @@ -21,9 +21,9 @@ use Symfony\Component\Validator\Exception\MissingOptionsException; */ class Count extends Constraint { - public $minMessage = 'This collection should contain {{ limit }} elements or more.'; - public $maxMessage = 'This collection should contain {{ limit }} elements or less.'; - public $exactMessage = 'This collection should contain exactly {{ limit }} elements.'; + public $minMessage = 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.'; + public $maxMessage = 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.'; + public $exactMessage = 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.'; public $min; public $max; diff --git a/src/Symfony/Component/Validator/Constraints/Length.php b/src/Symfony/Component/Validator/Constraints/Length.php index 70554c0686..cc355574ef 100644 --- a/src/Symfony/Component/Validator/Constraints/Length.php +++ b/src/Symfony/Component/Validator/Constraints/Length.php @@ -21,9 +21,9 @@ use Symfony\Component\Validator\Exception\MissingOptionsException; */ class Length extends Constraint { - public $maxMessage = 'This value is too long. It should have {{ limit }} characters or less.'; - public $minMessage = 'This value is too short. It should have {{ limit }} characters or more.'; - public $exactMessage = 'This value should have exactly {{ limit }} characters.'; + public $maxMessage = 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.'; + public $minMessage = 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.'; + public $exactMessage = 'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.'; public $max; public $min; public $charset = 'UTF-8'; diff --git a/src/Symfony/Component/Validator/Constraints/MaxLength.php b/src/Symfony/Component/Validator/Constraints/MaxLength.php index 57b9bff7db..a737e38c46 100644 --- a/src/Symfony/Component/Validator/Constraints/MaxLength.php +++ b/src/Symfony/Component/Validator/Constraints/MaxLength.php @@ -22,7 +22,7 @@ use Symfony\Component\Validator\Constraint; */ class MaxLength extends Constraint { - public $message = 'This value is too long. It should have {{ limit }} characters or less.'; + public $message = 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.'; public $limit; public $charset = 'UTF-8'; diff --git a/src/Symfony/Component/Validator/Constraints/MinLength.php b/src/Symfony/Component/Validator/Constraints/MinLength.php index 78c5d2c99b..9827ac330e 100644 --- a/src/Symfony/Component/Validator/Constraints/MinLength.php +++ b/src/Symfony/Component/Validator/Constraints/MinLength.php @@ -22,7 +22,7 @@ use Symfony\Component\Validator\Constraint; */ class MinLength extends Constraint { - public $message = 'This value is too short. It should have {{ limit }} characters or more.'; + public $message = 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.'; public $limit; public $charset = 'UTF-8'; diff --git a/src/Symfony/Component/Validator/DefaultTranslator.php b/src/Symfony/Component/Validator/DefaultTranslator.php index 850e0f1e16..c46856752d 100644 --- a/src/Symfony/Component/Validator/DefaultTranslator.php +++ b/src/Symfony/Component/Validator/DefaultTranslator.php @@ -36,7 +36,17 @@ class DefaultTranslator implements TranslatorInterface */ public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) { - return strtr($id, $parameters); + $ids = explode('|', $id); + + if (1 == $number) { + return strtr($ids[0], $parameters); + } + + if (!isset($ids[1])) { + throw new \InvalidArgumentException(sprintf('The message "%s" cannot be pluralized, because it is missing a plural (e.g. "There is one apple|There are %%count%% apples").', $id)); + } + + return strtr($ids[1], $parameters); } /** diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf index e6a29653b1..6100400159 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.af.xlf @@ -23,11 +23,11 @@ Die waarde wat jy gekies het is nie 'n geldige keuse nie. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Jy moet ten minste {{ limit }} kies.|Jy moet ten minste {{ limit }} keuses kies. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Jy moet by die meeste {{ limit }} keuse kies.|Jy moet by die meeste {{ limit }} keuses kies. @@ -75,7 +75,7 @@ Hierdie waarde moet {{ limit }} of minder wees. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Hierdie waarde is te lank. Dit moet {{ limit }} karakter of minder wees.|Hierdie waarde is te lank. Dit moet {{ limit }} karakters of minder wees. @@ -83,7 +83,7 @@ Hierdie waarde moet {{ limit }} of meer wees. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Hierdie waarde is te kort. Dit moet {{ limit }} karakter of meer wees.|Hierdie waarde is te kort. Dit moet {{ limit }} karakters of meer wees. @@ -179,7 +179,7 @@ Hierdie waarde moet die huidige wagwoord van die gebruiker wees. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Hierdie waarde moet presies {{ limit }} karakter wees.|Hierdie waarde moet presies {{ limit }} karakters wees. @@ -203,15 +203,15 @@ 'n PHP-uitbreiding veroorsaak die oplaai van die lêer om te misluk. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Hierdie versameling moet {{ limit }} element of meer bevat.|Hierdie versameling moet {{ limit }} elemente of meer bevat. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Hierdie versameling moet {{ limit }} element of minder bevat.|Hierdie versameling moet {{ limit }} elemente of meer bevat. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Hierdie versameling moet presies {{ limit }} element bevat.|Hierdie versameling moet presies {{ limit }} elemente bevat. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf index 9d5754c3cd..f6a67e7257 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf @@ -23,11 +23,11 @@ Избраната стойност е невалидна. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Трябва да изберете поне {{ limit }} опция.|Трябва да изберете поне {{ limit }} опции. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Трябва да изберете най-много {{ limit }} опция.|Трябва да изберете най-много {{ limit }} опции. @@ -75,7 +75,7 @@ Стойността трябва да бъде {{ limit }} или по-малко. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Стойността е твърде дълга. Трябва да съдържа най-много {{ limit }} символ.|Стойността е твърде дълга. Трябва да съдържа най-много {{ limit }} символа. @@ -83,7 +83,7 @@ Стойността трябва да бъде {{ limit }} или повече. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Стойността е твърде кратка. Трябва да съдържа поне {{ limit }} символ.|Стойността е твърде кратка. Трябва да съдържа поне {{ limit }} символа. @@ -179,7 +179,7 @@ Стойността трябва да бъде текущата потребителска парола. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Стойността трябва да бъде точно {{ limit }} символ.|Стойността трябва да бъде точно {{ limit }} символа. @@ -203,17 +203,17 @@ PHP разширение предизвика прекъсване на качването. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Колекцията трябва да съдържа поне {{ limit }} елемент.|Колекцията трябва да съдържа поне {{ limit }} елемента. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Колекцията трябва да съдържа най-много {{ limit }} елемент.|Колекцията трябва да съдържа най-много {{ limit }} елемента. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Колекцията трябва да съдържа точно {{ limit }} елемент.|Колекцията трябва да съдържа точно {{ limit }} елемента. - \ No newline at end of file + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf index 687598d825..49ac9b72bb 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf @@ -23,11 +23,11 @@ El valor seleccionat no és una opció vàlida. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Ha de seleccionar almenys {{ limit }} opció.|Ha de seleccionar almenys {{ limit }} opcions. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Ha de seleccionar com a màxim {{ limit }} opció.|Ha de seleccionar com a màxim {{ limit }} opcions. @@ -75,7 +75,7 @@ Aquest valor hauria de ser {{ limit }} o menys. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Aquest valor és massa llarg. Hauria de tenir {{ limit }} caràcter o menys.|Aquest valor és massa llarg. Hauria de tenir {{ limit }} caràcters o menys. @@ -83,7 +83,7 @@ Aquest valor hauria de ser {{ limit }} o més. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Aquest valor és massa curt. Hauria de tenir {{ limit }} caràcters o més. @@ -179,7 +179,7 @@ Aquest valor hauria de ser la contrasenya actual de l'usuari. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Aquest valor hauria de tenir exactament {{ limit }} caràcter.|Aquest valor hauria de tenir exactament {{ limit }} caràcters. @@ -203,15 +203,15 @@ Una extensió de PHP va fer que la pujada fallara. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Aquesta col·lecció ha de contenir {{ limit }} element o més.|Aquesta col·lecció ha de contenir {{ limit }} elements o més. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Aquesta col·lecció ha de contenir {{ limit }} element o menys.|Aquesta col·lecció ha de contenir {{ limit }} elements o menys. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Aquesta col·lecció ha de contenir exactament {{ limit }} element.|Aquesta col·lecció ha de contenir exactament {{ limit }} elements. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf index 60d5835442..e386b8e07f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf @@ -23,11 +23,11 @@ Vybraná hodnota není platnou možností. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Musí být vybrána nejméně {{ limit }} možnost.|Musí být vybrány nejméně {{ limit }} možnosti.|Musí být vybráno nejméně {{ limit }} možností. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Musí být vybrána maximálně {{ limit }} možnost.|Musí být vybrány maximálně {{ limit }} možnosti.|Musí být vybráno maximálně {{ limit }} možností. @@ -75,7 +75,7 @@ Tato hodnota musí být {{ limit }} nebo méně. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Tato hodnota je příliš dlouhá. Musí obsahovat maximálně {{ limit }} znak.|Tato hodnota je příliš dlouhá. Musí obsahovat maximálně {{ limit }} znaky.|Tato hodnota je příliš dlouhá. Musí obsahovat maximálně {{ limit }} znaků. @@ -83,7 +83,7 @@ Tato hodnota musí být {{ limit }} nebo více. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Tato hodnota je příliš krátká. Musí obsahovat minimálně {{ limit }} znak.|Tato hodnota je příliš krátká. Musí obsahovat minimálně {{ limit }} znaky.|Tato hodnota je příliš krátká. Musí obsahovat minimálně {{ limit }} znaků. @@ -179,7 +179,7 @@ Tato hodnota musí být aktuální heslo uživatele. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Tato hodnota musí mít přesně {{ limit }} znak.|Tato hodnota musí mít přesně {{ limit }} znaky.|Tato hodnota musí mít přesně {{limit}} znaků. @@ -203,15 +203,15 @@ Rozšíření PHP zabránilo nahrání souboru. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Tato kolekce musí obsahovat minimálně {{ limit }} prvek.|Tato kolekce musí obsahovat minimálně {{ limit }} prvky.|Tato kolekce musí obsahovat minimálně {{ limit }} prvků. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Tato kolekce musí obsahovat maximálně {{ limit }} prvek.|Tato kolekce musí obsahovat maximálně {{ limit }} prvky.|Tato kolekce musí obsahovat maximálně {{ limit }} prvků. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Tato kolekce musí obsahovat přesně {{ limit }} prvek.|Tato kolekce musí obsahovat přesně {{ limit }} prvky.|Tato kolekce musí obsahovat přesně {{ limit }} prvků. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf index e5cdf46d02..e6e7a86266 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.cy.xlf @@ -20,14 +20,14 @@ The value you selected is not a valid choice. - Nid yw'r gwerth ddewiswyd yn ddilys. + Nid yw'r gwerth � ddewiswyd yn ddilys. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Rhaid dewis o leiaf {{ limit }} opsiwn. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Rhaid dewis dim mwy na {{ limit }} opsiwn. @@ -64,18 +64,18 @@ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Mae'r ffeil yn rhy fawr ({{ size }} {{ suffix }}). Yr uchafswm ganiateir yw {{ limit }} {{ suffix }}. + Mae'r ffeil yn rhy fawr ({{ size }} {{ suffix }}). Yr uchafswm � ganiateir yw {{ limit }} {{ suffix }}. The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Nid yw math mime y ffeil yn ddilys ({{ type }}). Dyma'r mathau ganiateir {{ types }}. + Nid yw math mime y ffeil yn ddilys ({{ type }}). Dyma'r mathau � ganiateir {{ types }}. This value should be {{ limit }} or less. Dylai'r gwerth hwn fod yn {{ limit }} neu lai. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Mae'r gwerth hwn rhy hir. Dylai gynnwys {{ limit }} nodyn cyfrifiadurol neu lai. @@ -83,7 +83,7 @@ Dylai'r gwerth hwn fod yn {{ limit }} neu fwy. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Mae'r gwerth hwn yn rhy fyr. Dylai gynnwys {{ limit }} nodyn cyfrifiadurol neu fwy. @@ -116,7 +116,7 @@ The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Mae'r ffeil yn rhy fawr. Yr uchafswm ganiateir yw {{ limit }} {{ suffix }}. + Mae'r ffeil yn rhy fawr. Yr uchafswm � ganiateir yw {{ limit }} {{ suffix }}. The file is too large. @@ -124,7 +124,7 @@ The file could not be uploaded. - Methwyd uwchlwytho'r ffeil. + Methwyd � uwchlwytho'r ffeil. This value should be a valid number. @@ -156,35 +156,35 @@ The size of the image could not be detected. - Methwyd darganfod maint y ddelwedd. + Methwyd � darganfod maint y ddelwedd. The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Mae lled y ddelwedd yn rhy fawr ({{ width }}px). Y lled mwyaf ganiateir yw {{ max_width }}px. + Mae lled y ddelwedd yn rhy fawr ({{ width }}px). Y lled mwyaf � ganiateir yw {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Mae lled y ddelwedd yn rhy fach ({{ width }}px). Y lled lleiaf ganiateir yw {{ min_width }}px. + Mae lled y ddelwedd yn rhy fach ({{ width }}px). Y lled lleiaf � ganiateir yw {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Mae uchder y ddelwedd yn rhy fawr ({{ width }}px). Yr uchder mwyaf ganiateir yw {{ max_height }}px. + Mae uchder y ddelwedd yn rhy fawr ({{ width }}px). Yr uchder mwyaf � ganiateir yw {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Mae uchder y ddelwedd yn rhy fach ({{ width }}px). Yr uchder lleiaf ganiateir yw {{ min_height }}px. + Mae uchder y ddelwedd yn rhy fach ({{ width }}px). Yr uchder lleiaf � ganiateir yw {{ min_height }}px. This value should be the user current password. Dylaid bod y gwerth hwn yn gyfrinair presenol y defnyddiwr. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Dylai'r gwerth hwn fod yn union {{ limit }} nodyn cyfrifiadurol o hyd. The file was only partially uploaded. - Dim ond rhan o'r ffeil uwchlwythwyd. + Dim ond rhan o'r ffeil � uwchlwythwyd. No file was uploaded. @@ -196,22 +196,22 @@ Cannot write temporary file to disk. - Methwyd ysgrifennu'r ffeil dros-dro ar ddisg. + Methwyd � ysgrifennu'r ffeil dros-dro ar ddisg. A PHP extension caused the upload to fail. - Methwyd uwchlwytho oherwydd ategyn PHP. + Methwyd � uwchlwytho oherwydd ategyn PHP. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Dylai'r casgliad hwn gynnwys {{ limit }} elfen neu fwy. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Dylai'r casgliad hwn gynnwys {{ limit }} elfen neu lai. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Dylai'r casgliad hwn gynnwys union {{ limit }} elfen. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf index 8d3e6531c2..70fee3b4ce 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.da.xlf @@ -23,11 +23,11 @@ Værdien skal være en af de givne muligheder. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Du skal vælge mindst {{ limit }} muligheder. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Du kan højest vælge {{ limit }} muligheder. @@ -75,7 +75,7 @@ Værdien skal være {{ limit }} eller mindre. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Værdien er for lang. Den skal have {{ limit }} bogstaver eller mindre. @@ -83,7 +83,7 @@ Værdien skal være {{ limit }} eller mere. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Værdien er for kort. Den skal have {{ limit }} tegn eller flere. @@ -179,7 +179,7 @@ Værdien skal være brugerens nuværende password. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Værdien skal have præcis {{ limit }} tegn. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index ad4153adfa..2cc17204b2 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -23,11 +23,11 @@ Sie haben einen ungültigen Wert ausgewählt. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Sie müssen mindestens {{ limit }} Möglichkeit wählen.|Sie müssen mindestens {{ limit }} Möglichkeiten wählen. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Sie dürfen höchstens {{ limit }} Möglichkeit wählen.|Sie dürfen höchstens {{ limit }} Möglichkeiten wählen. @@ -75,7 +75,7 @@ Dieser Wert sollte kleiner oder gleich {{ limit }} sein. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Diese Zeichenkette ist zu lang. Sie sollte höchstens {{ limit }} Zeichen haben.|Diese Zeichenkette ist zu lang. Sie sollte höchstens {{ limit }} Zeichen haben. @@ -83,7 +83,7 @@ Dieser Wert sollte größer oder gleich {{ limit }} sein. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Diese Zeichenkette ist zu kurz. Sie sollte mindestens {{ limit }} Zeichen haben.|Diese Zeichenkette ist zu kurz. Sie sollte mindestens {{ limit }} Zeichen haben. @@ -179,7 +179,7 @@ Dieser Wert sollte dem aktuellen Benutzerpasswort entsprechen. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Dieser Wert sollte genau {{ limit }} Zeichen lang sein.|Dieser Wert sollte genau {{ limit }} Zeichen lang sein. @@ -203,15 +203,15 @@ Eine PHP-Erweiterung verhinderte den Upload. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Diese Sammlung sollte {{ limit }} oder mehr Elemente beinhalten.|Diese Sammlung sollte {{ limit }} oder mehr Elemente beinhalten. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Diese Sammlung sollte {{ limit }} oder weniger Elemente beinhalten.|Diese Sammlung sollte {{ limit }} oder weniger Elemente beinhalten. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Diese Sammlung sollte genau {{ limit }} Element beinhalten.|Diese Sammlung sollte genau {{ limit }} Elemente beinhalten. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 346614f066..5c910b451d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -23,11 +23,11 @@ The value you selected is not a valid choice. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. @@ -75,7 +75,7 @@ This value should be {{ limit }} or less. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. @@ -83,7 +83,7 @@ This value should be {{ limit }} or more. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. @@ -179,7 +179,7 @@ This value should be the user current password. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. @@ -203,15 +203,15 @@ A PHP extension caused the upload to fail. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index b1a31a4bdf..980767bd27 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -23,11 +23,11 @@ El valor seleccionado no es una opción válida. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Debe seleccionar al menos {{ limit }} opción.|Debe seleccionar al menos {{ limit }} opciones. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Debe seleccionar como máximo {{ limit }} opción.|Debe seleccionar como máximo {{ limit }} opciones. @@ -75,7 +75,7 @@ Este valor debería ser {{ limit }} o menos. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Este valor es demasiado largo. Debería tener {{ limit }} carácter o menos.|Este valor es demasiado largo. Debería tener {{ limit }} caracteres o menos. @@ -83,7 +83,7 @@ Este valor debería ser {{ limit }} o más. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Este valor es demasiado corto. Debería tener {{ limit }} carácter o más.|Este valor es demasiado corto. Debería tener {{ limit }} caracteres o más. @@ -179,7 +179,7 @@ Este valor debería ser la contraseña actual del usuario. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Este valor debería tener exactamente {{ limit }} carácter.|Este valor debería tener exactamente {{ limit }} caracteres. @@ -203,15 +203,15 @@ Una extensión de PHP hizo que la subida fallara. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Esta colección debe contener {{ limit }} elemento o más.|Esta colección debe contener {{ limit }} elementos o más. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Esta colección debe contener {{ limit }} elemento o menos.|Esta colección debe contener {{ limit }} elementos o menos. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Esta colección debe contener exactamente {{ limit }} elemento.|Esta colección debe contener exactamente {{ limit }} elementos. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf index 3f9c9a8f75..b77d59f308 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.et.xlf @@ -23,11 +23,11 @@ Väärtus peaks olema üks etteantud valikutest. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Valima peaks vähemalt {{ limit }} valikut. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Valima peaks mitte rohkem kui {{ limit }} valikut. @@ -75,7 +75,7 @@ Väärtus peaks olema {{ limit }} või vähem. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Väärtus on liiga pikk. Pikkus peaks olema {{ limit }} tähemärki või vähem. @@ -83,7 +83,7 @@ Väärtus peaks olema {{ limit }} või rohkem. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Väärtus on liiga lühike. Pikkus peaks olema {{ limit }} tähemärki või rohkem. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf index b1864bd60f..f008091845 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf @@ -23,11 +23,11 @@ Hautatu duzun balioa ez da aukera egoki bat. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Gutxienez {{ limit }} aukera hautatu behar dituzu. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Gehienez {{ limit }} aukera hautatu behar dituzu. @@ -75,7 +75,7 @@ Balio honek {{ limit }} edo gutxiago izan beharko luke. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Balio hau luzeegia da. {{ limit }} karaktere edo gutxiago eduki beharko lituzke. @@ -83,7 +83,7 @@ Balio honek {{ limit }} edo handiago izan beharko luke. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Balio hau motzegia da. {{ limit }} karaktere edo gehiago eduki beharko lituzke. @@ -179,7 +179,7 @@ Balio honek uneko erabiltzailearen pasahitza izan beharko luke. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Balio honek zehazki {{ limit }} karaktere izan beharko lituzke. @@ -203,15 +203,15 @@ PHP luzapen batek igoeraren hutsa eragin du. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Bilduma honek {{ limit }} elementu edo gehiago eduki beharko lituzke. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Bilduma honek {{ limit }} elementu edo gutxiago eduki beharko lituzke. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Bilduma honek zehazki {{ limit }} elementu eduki beharko lituzke. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf index 9ea4b83221..e44ac029bd 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf @@ -23,11 +23,11 @@ گزینه انتخابی معتبر نیست. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. باید حداقل {{ limit }} گزینه انتخاب کنید. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. حداکثر {{ limit }} گزینه می توانید انتخاب کنید. @@ -75,7 +75,7 @@ این مقدار باید کوچکتر یا مساوی {{ limit }} باشد. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. بسیار طولانی است.حداکثر تعداد حروف مجاز برابر {{ limit }} است. @@ -83,7 +83,7 @@ این مقدار باید برابر و یا بیشتر از {{ limit }} باشد. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. بسیار کوتاه است.تعداد حروف باید حداقل {{ limit }} باشد. @@ -179,7 +179,7 @@ این مقدار می بایست کلمه عبور کنونی کاربر باشد. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. این مقدار می بایست دقیفا {{ limit }} کاراکتر داشته باشد.|این مقدرا می بایشت دقیقا {{ limit }} کاراکتر داشته باشد. @@ -203,15 +203,15 @@ اکستنشن PHP موجب شد که بارگذاری فایل با شکست مواجه شود. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. این مجموعه می بایست دارای {{ limit }} عنصر یا بیشتر باشد.|این مجموعه می بایست دارای {{ limit }} عنصر یا بیشتر باشد. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. این مجموعه می بایست دارای حداقل {{ limit }} عنصر یا کمتر باشد.|این مجموعه می بایست دارای {{ limit }} عنصر یا کمتر باشد. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. این مجموعه می بایست به طور دقیق دارا {{ limit }} عنصر باشد.|این مجموعه می بایست به طور دقیق دارای {{ limit }} قلم باشد. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf index 1dd7a00927..99f90b09f1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fi.xlf @@ -23,11 +23,11 @@ Arvon tulee olla yksi annetuista vaihtoehdoista. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Sinun tulee valita vähintään {{ limit }} vaihtoehtoa. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Sinun tulee valitan enintään {{ limit }} vaihtoehtoa. @@ -75,7 +75,7 @@ Arvon tulee olla {{ limit }} tai vähemmän. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Liian pitkä syöte. Syöte saa olla enintään {{ limit }} merkkiä. @@ -83,7 +83,7 @@ Arvon tulee olla {{ limit }} tai enemmän. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Liian lyhyt syöte. Syötteen tulee olla vähintään {{ limit }} merkkiä. @@ -179,7 +179,7 @@ Tämän arvon tulisi olla käyttäjän tämänhetkinen salasana. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Tämän arvon tulisi olla tasan yhden merkin pituinen.|Tämän arvon tulisi olla tasan {{ limit }} merkkiä pitkä. @@ -203,15 +203,15 @@ PHP-laajennoksen vuoksi tiedoston lataus epäonnistui. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Tässä ryhmässä tulisi olla yksi tai useampi elementti.|Tässä ryhmässä tulisi olla vähintään {{ limit }} elementtiä. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Tässä ryhmässä tulisi olla enintään yksi elementti.|Tässä ryhmässä tulisi olla enintään {{ limit }} elementtiä. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Tässä ryhmässä tulisi olla tasan yksi elementti.|Tässä ryhmässä tulisi olla enintään {{ limit }} elementtiä. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index e6ca4a7f8a..0210fac557 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -23,11 +23,11 @@ Cette valeur doit être l'un des choix proposés. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Vous devez sélectionner au moins {{ limit }} choix.|Vous devez sélectionner au moins {{ limit }} choix. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Vous devez sélectionner au maximum {{ limit }} choix.|Vous devez sélectionner au maximum {{ limit }} choix. @@ -75,7 +75,7 @@ Cette valeur doit être inférieure ou égale à {{ limit }}. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Cette chaine est trop longue. Elle doit avoir au maximum {{ limit }} caractère.|Cette chaine est trop longue. Elle doit avoir au maximum {{ limit }} caractères. @@ -83,7 +83,7 @@ Cette valeur doit être supérieure ou égale à {{ limit }}. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Cette chaine est trop courte. Elle doit avoir au minimum {{ limit }} caractère.|Cette chaine est trop courte. Elle doit avoir au minimum {{ limit }} caractères. @@ -179,7 +179,7 @@ Cette valeur doit être le mot de passe actuel de l'utilisateur. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Cette chaine doit avoir exactement {{ limit }} caractère.|Cette chaine doit avoir exactement {{ limit }} caractères. @@ -203,15 +203,15 @@ Une extension PHP a empêché le transfert du fichier. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Cette collection doit contenir {{ limit }} élément ou plus.|Cette collection doit contenir {{ limit }} éléments ou plus. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Cette collection doit contenir {{ limit }} élément ou moins.|Cette collection doit contenir {{ limit }} éléments ou moins. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Cette collection doit contenir exactement {{ limit }} élément.|Cette collection doit contenir exactement {{ limit }} éléments. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf index 2994dba4ce..5f61f97337 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.gl.xlf @@ -23,11 +23,11 @@ O valor seleccionado non é unha opción válida. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Debe seleccionar polo menos {{ limit }} opción.|Debe seleccionar polo menos {{ limit }} opcions. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Debe seleccionar como máximo {{ limit }} opción.|Debe seleccionar como máximo {{ limit }} opcions. @@ -75,7 +75,7 @@ Este valor debería ser {{ limit }} ou menos. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Este valor é demasiado longo. Debería ter {{ limit }} carácter ou menos.|Este valor é demasiado longo. Debería ter {{ limit }} caracteres ou menos. @@ -83,7 +83,7 @@ Este valor debería ser {{ limit }} ou máis. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Este valor é demasiado curto. Debería ter {{ limit }} carácter ou máis.|Este valor é demasiado corto. Debería ter {{ limit }} caracteres ou máis. @@ -179,7 +179,7 @@ Este valor debería ser a contrasinal actual do usuario. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Este valor debería ter exactamente {{ limit }} carácter.|Este valor debería ter exactamente {{ limit }} caracteres. @@ -203,15 +203,15 @@ Unha extensión de PHP provocou que a subida fallara. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Esta colección debe conter {{ limit }} elemento ou máis.|Esta colección debe conter {{ limit }} elementos ou máis. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Esta colección debe conter {{ limit }} elemento ou menos.|Esta colección debe conter {{ limit }} elementos ou menos. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Esta colección debe conter exactamente {{ limit }} elemento.|Esta colección debe conter exactamente {{ limit }} elementos. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf index 9be564e60b..520e5bae72 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.he.xlf @@ -23,11 +23,11 @@ הערך שבחרת אינו חוקי. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. אתה צריך לבחור לפחות {{ limit }} אפשרויות.|אתה צריך לבחור לפחות {{ limit }} אפשרויות. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. אתה צריך לבחור לכל היותר {{ limit }} אפשרויות.|אתה צריך לבחור לכל היותר {{ limit }} אפשרויות. @@ -75,7 +75,7 @@ הערך צריל להכיל {{ limit }} תווים לכל היותר. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. הערך ארוך מידי. הוא צריך להכיל {{ limit }} תווים לכל היותר.|הערך ארוך מידי. הוא צריך להכיל {{ limit }} תווים לכל היותר. @@ -83,7 +83,7 @@ הערך צריך להכיל {{ limit }} תווים לפחות. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. הערך קצר מידיץ הוא צריך להכיל {{ limit }} תווים לפחות.|הערך קצר מידיץ הוא צריך להכיל {{ limit }} תווים לפחות. @@ -179,7 +179,7 @@ הערך צריך להיות סיסמת המשתמש הנוכחי. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. הערך צריך להיות בדיוק {{ limit }} תווים.|הערך צריך להיות בדיוק {{ limit }} תווים. @@ -203,15 +203,15 @@ סיומת PHP גרם להעלאה להיכשל. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. האוסף אמור להכיל {{ limit }} אלמנטים או יותר.|האוסף אמור להכיל {{ limit }} אלמנטים או יותר. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. האוסף אמור להכיל {{ limit }} אלמנטים או פחות.|האוסף אמור להכיל {{ limit }} אלמנטים או פחות. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. האוסף צריך להכיל בדיוק {{ limit }} אלמנטים.|האוסף צריך להכיל בדיוק {{ limit }} אלמנטים. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf index f6bb1c95d5..5873d5f842 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf @@ -23,11 +23,11 @@ Ova vrijednost treba biti jedna od ponuđenih. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Izaberite barem {{ limit }} mogućnosti. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Izaberite najviše {{ limit }} mogućnosti. @@ -75,7 +75,7 @@ Ova vrijednost treba biti {{ limit }} ili manje. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Ova vrijednost je predugačka. Treba imati {{ limit }} znakova ili manje. @@ -83,7 +83,7 @@ Ova vrijednost treba biti {{ limit }} ili više. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Ova vrijednost je prekratka. Treba imati {{ limit }} znakova ili više. @@ -179,7 +179,7 @@ Ova vrijednost treba biti trenutna korisnička lozinka. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Ova vrijednost treba imati točno {{ limit }} znakova. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf index 004d304c3b..ab10c5a738 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf @@ -23,11 +23,11 @@ Ez az érték a megadottak egyike legyen. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Legalább {{ limit }} értéket kell kiválasztani. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Legfeljebb {{ limit }} értéket lehet kiválasztani. @@ -75,7 +75,7 @@ Ez az érték {{ limit }} vagy kevesebb legyen. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Ez az érték túl hosszú. {{ limit }} karaktert vagy kevesebbet tartalmazzon. @@ -83,7 +83,7 @@ Ez az érték {{ limit }} vagy több legyen. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Ez az érték túl rövid. {{ limit }} karaktert vagy többet tartalmazzon. @@ -179,7 +179,7 @@ Ez az érték a felhasználó jelenlegi jelszava legyen. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Ez az érték pontosan {{ limit }} karaktert tartalmazzon. @@ -203,15 +203,15 @@ Egy PHP bővítmény miatt a feltöltés nem sikerült. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Ez a gyűjtemény {{ limit }} elemet vagy többet tartalmazzon. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Ez a gyűjtemény {{ limit }} elemet vagy kevesebbet tartalmazzon. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Ez a gyűjetemény pontosan {{ limit }} elemet tartalmazzon. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf index 7b161c99f8..262b93b8bc 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hy.xlf @@ -23,11 +23,11 @@ Ձեր ընտրած արժեքը անթույլատրելի է. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Դուք պետք է ընտրեք ամենաքիչը {{ limit }} տարբերակներ. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Դուք պետք է ընտրեք ոչ ավելի քան {{ limit }} տարբերակներ. @@ -75,7 +75,7 @@ Արժեքը պետք է լինի {{ limit }} կամ փոքր. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Արժեքը չափազանց երկար է: Պետք է լինի {{ limit }} կամ ավել սիմվոլներ. @@ -83,7 +83,7 @@ Արժեքը պետ է լինի {{ limit }} կամ շատ. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Արժեքը չափազանց կարճ է: Պետք է լինի {{ limit }} կամ ավելի սիմվոլներ. @@ -179,9 +179,9 @@ Այս արժեքը պետք է լինի օգտագործողի ներկա ծածկագիրը. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Այս արժեքը պետք է ունենա ճիշտ {{ limit }} սիմվոլներ. - \ No newline at end of file + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf index 139c6b8e1b..816489f7a1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.id.xlf @@ -23,11 +23,11 @@ Nilai yang dipilih tidak tepat. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Anda harus memilih paling tidak {{ limit }} pilihan. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Anda harus memilih paling banyak {{ limit }} pilihan. @@ -75,7 +75,7 @@ Nilai ini harus {{ limit }} atau kurang. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Nilai ini terlalu panjang. Seharusnya {{ limit }} karakter atau kurang. @@ -83,7 +83,7 @@ Nilai ini harus {{ limit }} atau lebih. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Nilai ini terlalu pendek. Seharusnya {{ limit }} karakter atau lebih. @@ -179,7 +179,7 @@ Nilai ini harus kata sandi pengguna saat ini. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Nilai ini harus memiliki tepat {{ limit }} karakter. @@ -203,15 +203,15 @@ Sebuah ekstensi PHP menyebabkan kegagalan unggah. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Kumpulan ini harus memiliki {{ limit }} elemen atau lebih. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Kumpulan ini harus memiliki kurang dari {{ limit }} elemen. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Kumpulan ini harus memiliki tepat {{ limit }} elemen. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf index a463e247cc..9068ba43c1 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.it.xlf @@ -23,11 +23,11 @@ Questo valore dovrebbe essere una delle opzioni disponibili. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Si dovrebbe selezionare almeno {{ limit }} opzione.|Si dovrebbero selezionare almeno {{ limit }} opzioni. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Si dovrebbe selezionare al massimo {{ limit }} opzione.|Si dovrebbero selezionare al massimo {{ limit }} opzioni. @@ -75,7 +75,7 @@ Questo valore dovrebbe essere {{ limit }} o inferiore. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Questo valore è troppo lungo. Dovrebbe essere al massimo di {{ limit }} carattere.|Questo valore è troppo lungo. Dovrebbe essere al massimo di {{ limit }} caratteri. @@ -83,7 +83,7 @@ Questo valore dovrebbe essere {{ limit }} o superiore. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Questo valore è troppo corto. Dovrebbe essere almeno di {{ limit }} carattere.|Questo valore è troppo corto. Dovrebbe essere almeno di {{ limit }} caratteri. @@ -179,7 +179,7 @@ Questo valore dovrebbe essere la password attuale dell'utente. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Questo valore dovrebbe contenere esattamente {{ limit }} carattere.|Questo valore dovrebbe contenere esattamente {{ limit }} caratteri. @@ -203,15 +203,15 @@ Un'estensione PHP ha causato il fallimento del caricamento. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Questa collezione dovrebbe contenere almeno {{ limit }} elemento.|Questa collezione dovrebbe contenere almeno {{ limit }} elementi. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Questa collezione dovrebbe contenere massimo {{ limit }} elemento.|Questa collezione dovrebbe contenere massimo {{ limit }} elementi. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Questa collezione dovrebbe contenere esattamente {{ limit }} elemento.|Questa collezione dovrebbe contenere esattamente {{ limit }} elementi. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf index c8b4632330..cc823ea301 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf @@ -23,11 +23,11 @@ 選択された値は選択肢として有効な値ではありません. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. {{ limit }}個以上選択してください. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. {{ limit }}個以内で選択してください. @@ -75,7 +75,7 @@ 値は{{ limit }}以下でなければなりません. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. 値が長すぎます。{{ limit }}文字以内でなければなりません. @@ -83,7 +83,7 @@ 値は{{ limit }}以上でなければなりません. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. 値が短すぎます。{{ limit }}文字以上でなければなりません. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf index ab3ea6bb78..c66f1fd67e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf @@ -23,11 +23,11 @@ Dëse Wäert sollt enger vun de Wielméiglechkeeten entspriechen. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Dir sollt mindestens {{ limit }} Méiglechkeete wielen. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Dir sollt héchstens {{ limit }} Méiglechkeete wielen. @@ -75,7 +75,7 @@ Dëse Wäert soll méi kleng oder gläich {{ limit }} sinn. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Dës Zeecheketten ass ze laang. Se sollt héchstens {{ limit }} Zeechen hunn. @@ -83,7 +83,7 @@ Dëse Wäert sollt méi grouss oder gläich {{ limit }} sinn. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Dës Zeecheketten ass ze kuerz. Se sollt mindestens {{ limit }} Zeechen hunn. @@ -179,7 +179,7 @@ Dëse Wäert sollt dem aktuelle Benotzerpasswuert entspriechen. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Dëse Wäert sollt exactly {{ limit }} Buschtaf hunn.|Dëse Wäert sollt exakt {{ limit }} Buschtawen hunn. @@ -203,15 +203,15 @@ Eng PHP-Erweiderung huet den Upload verhënnert. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Dës Sammlung sollt {{ limit }} oder méi Elementer hunn. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Dës Sammlung sollt {{ limit }} oder manner Elementer hunn. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Dës Sammlung sollt exakt {{ limit }} Element hunn.|Dës Sammlung sollt exakt {{ limit }} Elementer hunn. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf index 140e6977ce..d47fa54b16 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.lt.xlf @@ -23,11 +23,11 @@ Neteisingas pasirinkimas. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Turite pasirinkti bent {{ limit }} variantą.|Turite pasirinkti bent {{ limit }} variantus.|Turite pasirinkti bent {{ limit }} variantų. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Turite pasirinkti ne daugiau kaip {{ limit }} variantą.|Turite pasirinkti ne daugiau kaip {{ limit }} variantus.|Turite pasirinkti ne daugiau kaip {{ limit }} variantų. @@ -75,7 +75,7 @@ Reikšmė turi būti {{ limit }} arba mažiau. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Per didelis simbolių skaičius. Turi susidaryti iš {{ limit }} arba mažiau simbolių.|Per didelis simbolių skaičius. Turi susidaryti iš {{ limit }} arba mažiau simbolių.|Per didelis simbolių skaičius. Turi susidaryti iš {{ limit }} arba mažiau simbolių. @@ -83,7 +83,7 @@ Reikšmė turi būti {{ limit }} arba daugiau. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Per mažas simbolių skaičius. Turi susidaryti iš {{ limit }} arba daugiau simbolių.|Per mažas simbolių skaičius. Turi susidaryti iš {{ limit }} arba daugiau simbolių.|Per mažas simbolių skaičius. Turi susidaryti iš {{ limit }} arba daugiau simbolių. @@ -179,7 +179,7 @@ Ši reikšmė turi sutapti su dabartiniu vartotojo slaptažodžiu. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Ši reikšmė turi turėti lygiai {{ limit }} simbolį.|Ši reikšmė turi turėti lygiai {{ limit }} simbolius.|Ši reikšmė turi turėti lygiai {{ limit }} simbolių. @@ -203,15 +203,15 @@ PHP plėtinys sutrukdė failo įkėlimą ir jis nepavyko. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Sąraše turi būti {{ limit }} arba daugiau įrašų.|Sąraše turi būti {{ limit }} arba daugiau įrašų.|Sąraše turi būti {{ limit }} arba daugiau įrašų. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Sąraše turi būti {{ limit }} arba mažiau įrašų.|Sąraše turi būti {{ limit }} arba mažiau įrašų.|Sąraše turi būti {{ limit }} arba mažiau įrašų. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Sąraše turi būti lygiai {{ limit }} įrašas.|Sąraše turi būti lygiai {{ limit }} įrašai.|Sąraše turi būti lygiai {{ limit }} įrašų. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf index ab4ab09179..e238061338 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.mn.xlf @@ -23,11 +23,11 @@ Сонгосон утга буруу байна. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Хамгийн багадаа {{ limit }} утга сонгогдсон байх ёстой. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Хамгийн ихдээ {{ limit }} утга сонгогдох боломжтой. @@ -75,7 +75,7 @@ Энэ утга {{ limit }} юмуу эсвэл бага байна. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Энэ утга хэтэрхий урт байна. {{ limit }} тэмдэгтийн урттай юмуу эсвэл бага байна. @@ -83,7 +83,7 @@ Энэ утга {{ limit }} юмуу эсвэл их байна. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Энэ утга хэтэрхий богино байна. {{ limit }} тэмдэгт эсвэл их байна. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf index 248c64259b..086b8b0b08 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nb.xlf @@ -23,11 +23,11 @@ Verdien skal være en av de gitte valg. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Du skal velge minst {{ limit }} valg. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Du kan maks velge {{ limit }} valg. @@ -75,7 +75,7 @@ Verdien skal være {{ limit }} eller mindre. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Verdien er for lang. Den skal ha {{ limit }} bokstaver eller mindre. @@ -83,7 +83,7 @@ Verdien skal være {{ limit }} eller mer. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Verdien er for kort. Den skal ha {{ limit }} tegn eller flere. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index 252030a9e4..e9630ae19f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -23,11 +23,11 @@ De geselecteerde waarde is geen geldige optie. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Selecteer ten minste {{ limit }} optie.|Selecteer ten minste {{ limit }} opties. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Selecteer maximaal {{ limit }} optie.|Selecteer maximaal {{ limit }} opties. @@ -75,7 +75,7 @@ Deze waarde moet {{ limit }} of minder zijn. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Deze waarde is te lang. Hij mag maximaal {{ limit }} teken bevatten.|Deze waarde is te lang. Hij mag maximaal {{ limit }} tekens bevatten. @@ -83,7 +83,7 @@ Deze waarde moet {{ limit }} of meer zijn. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Deze waarde is te kort. Hij moet tenminste {{ limit }} teken bevatten.|Deze waarde is te kort. Hij moet tenminste {{ limit }} tekens bevatten. @@ -179,7 +179,7 @@ Deze waarde moet het huidige wachtwoord van de gebruiker zijn. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Deze waarde moet exact {{ limit }} tekens lang zijn. @@ -203,15 +203,15 @@ De upload is mislukt vanwege een PHP-extensie. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Deze collectie moet {{ limit }} element of meer bevatten.|Deze collectie moet {{ limit }} elementen of meer bevatten. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Deze collectie moet {{ limit }} element of minder bevatten.|Deze collectie moet {{ limit }} elementen of minder bevatten. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Deze collectie moet exact {{ limit }} element bevatten.|Deze collectie moet exact {{ limit }} elementen bevatten. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf index 94d8462b88..51d0cae142 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.no.xlf @@ -23,11 +23,11 @@ Verdien du valgte er ikkje gyldig. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Du må velge minst {{ limit }} valg. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Du kan maksimalt gjere {{ limit }} valg. @@ -75,7 +75,7 @@ Verdien må vere {{ limit }} eller mindre. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Verdien er for lang. Den må vere {{ limit }} bokstavar eller mindre. @@ -83,7 +83,7 @@ Verdien må vere {{ limit }} eller meir. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Verdien er for kort. Den må ha {{ limit }} teikn eller fleire. @@ -179,7 +179,7 @@ Verdien må vere brukaren sitt noverande passord. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Verdien må vere nøyaktig {{ limit }} teikn. @@ -203,15 +203,15 @@ Ei PHP-udviding forårsaka feil under opplasting. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Denne samlinga må innehalde {{ limit }} element eller meir.|Denne samlinga må innehalde {{ limit }} element eller meir. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Denne samlinga må innehalde {{ limit }} element eller færre.|Denne samlinga må innehalde {{ limit }} element eller færre. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Denne samlinga må innehalde nøyaktig {{ limit }} element.|Denne samlinga må innehalde nøyaktig {{ limit }} element. @@ -224,4 +224,4 @@ - \ No newline at end of file + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf index 0d0b91ab8c..18d03b6c6e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf @@ -23,11 +23,11 @@ Ta wartość powinna być jedną z podanych opcji. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Powinieneś wybrać co najmniej {{ limit }} opcję.|Powinieneś wybrać co najmniej {{ limit }} opcje.|Powinieneś wybrać co najmniej {{ limit }} opcji. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Powinieneś wybrać maksymalnie {{ limit }} opcję.|Powinieneś wybrać maksymalnie {{ limit }} opcje.|Powinieneś wybrać maksymalnie {{ limit }} opcji. @@ -75,7 +75,7 @@ Ta wartość powinna wynosić {{ limit }} lub mniej. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Ta wartość jest zbyt długa. Powinna mieć {{ limit }} lub mniej znaków.|Ta wartość jest zbyt długa. Powinna mieć {{ limit }} lub mniej znaków.|Ta wartość jest zbyt długa. Powinna mieć {{ limit }} lub mniej znaków. @@ -83,7 +83,7 @@ Ta wartość powinna wynosić {{ limit }} lub więcej. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Ta wartość jest zbyt krótka. Powinna mieć {{ limit }} lub więcej znaków.|Ta wartość jest zbyt krótka. Powinna mieć {{ limit }} lub więcej znaków.|Ta wartość jest zbyt krótka. Powinna mieć {{ limit }} lub więcej znaków. @@ -179,7 +179,7 @@ Ta wartość powinna być aktualnym hasłem użytkownika. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Ta wartość powinna mieć dokładnie {{ limit }} znak.|Ta wartość powinna mieć dokładnie {{ limit }} znaki.|Ta wartość powinna mieć dokładnie {{ limit }} znaków. @@ -203,15 +203,15 @@ Rozszerzenie PHP spowodowało błąd podczas wgrywania. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Ten zbiór powinien zawierać {{ limit }} lub więcej elementów. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Ten zbiór powinien zawierać {{ limit }} lub mniej elementów. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Ten zbiór powinien zawierać dokładnie {{ limit }} element.|Ten zbiór powinien zawierać dokładnie {{ limit }} elementy.|Ten zbiór powinien zawierać dokładnie {{ limit }} elementów. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf index ce9bb90464..454e17612c 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf @@ -23,11 +23,11 @@ O valor selecionado não é uma opção válida. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Você deveria selecionar {{ limit }} opção no mínimo.|Você deveria selecionar {{ limit }} opções no mínimo. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Você deve selecionar, no máximo {{ limit }} opção.|Você deve selecionar, no máximo {{ limit }} opções. @@ -75,7 +75,7 @@ Este valor deveria ser {{ limit }} ou menor. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. O valor é muito longo. Deveria ter {{ limit }} caracteres ou menos. @@ -83,7 +83,7 @@ Este valor deveria ser {{ limit }} ou mais. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. O valor é muito curto. Deveria de ter {{ limit }} caractere ou mais.|O valor é muito curto. Deveria de ter {{ limit }} caracteres ou mais. @@ -179,7 +179,7 @@ Este valor deveria de ser a password atual do utilizador. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Este valor tem de ter exatamente {{ limit }} carateres. @@ -203,15 +203,15 @@ Uma extensão PHP causou a falha no envio. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Esta coleção deve conter {{ limit }} elemento ou mais.|Esta coleção deve conter {{ limit }} elementos ou mais. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Esta coleção deve conter {{ limit }} elemento ou menos.|Esta coleção deve conter {{ limit }} elementos ou menos. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Esta coleção deve conter exatamente {{ limit }} elemento.|Esta coleção deve conter exatamente {{ limit }} elementos. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf index 40df6f4466..fb4524248b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf @@ -23,11 +23,11 @@ O valor selecionado não é uma opção válida. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Você deve selecionar, no mínimo, {{ limit }} opção.|Você deve selecionar, no mínimo, {{ limit }} opções - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Você deve selecionar, no máximo, {{ limit }} opção.|Você deve selecionar, no máximo, {{ limit }} opções. @@ -75,7 +75,7 @@ Este valor deve ser {{ limit }} ou menos. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Este valor é muito longo. Deve ter {{ limit }} caractere ou menos.|Este valor é muito longo. Deve ter {{ limit }} caracteres ou menos. @@ -83,7 +83,7 @@ Este valor deve ser {{ limit }} ou mais. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Este valor é muito curto. Deve ter {{ limit }} caractere ou mais.|Este valor é muito curto. Deve ter {{ limit }} caracteres ou mais. @@ -179,7 +179,7 @@ Este valor deve ser a senha atual do usuário. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Este valor deve ter exatamente {{ limit }} caractere.|Este valor deve ter exatamente {{ limit }} caracteres. @@ -203,15 +203,15 @@ Uma extensão PHP fez com que o envio falhasse. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Esta coleção deve conter {{ limit }} elemento ou mais.|Esta coleção deve conter {{ limit }} elementos ou mais. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Esta coleção deve conter {{ limit }} elemento ou menos.|Esta coleção deve conter {{ limit }} elementos ou menos. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Esta coleção deve conter exatamente {{ limit }} elemento.|Esta coleção deve conter exatamente {{ limit }} elementos. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf index e1c4c44a2c..fa45d3ed75 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf @@ -23,11 +23,11 @@ Valoarea selectată nu este o opțiune validă. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Trebuie să selectați cel puțin {{ limit }} opțiuni. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Trebuie să selectați cel mult {{ limit }} opțiuni. @@ -75,7 +75,7 @@ Această valoare ar trebui să fie cel mult {{ limit }}. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caracter.|Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caractere. @@ -83,7 +83,7 @@ Această valoare ar trebui să fie cel puțin {{ limit }}. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caracter.|Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caractere. @@ -179,7 +179,7 @@ Această valoare trebuie să fie parola curentă a utilizatorului. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Această valoare trebuie să conțină exact {{ limit }} caracter.|Această valoare trebuie să conțină exact {{ limit }} caractere. @@ -203,15 +203,15 @@ O extensie PHP a prevenit încărcarea cu succes a fișierului. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Această colecție trebuie să conțină cel puțin {{ limit }} elemente. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Această colecție trebuie să conțină cel mult {{ limit }} elemente. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Această colecție trebuie să conțină {{ limit }} elemente. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf index c5977dd5a3..4fd4b96b2b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.ru.xlf @@ -23,11 +23,11 @@ Выбранное Вами значение недопустимо. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Вы должны выбрать хотя бы {{ limit }} вариант.|Вы должны выбрать хотя бы {{ limit }} варианта.|Вы должны выбрать хотя бы {{ limit }} вариантов. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Вы должны выбрать не более чем {{ limit }} вариант.|Вы должны выбрать не более чем {{ limit }} варианта.|Вы должны выбрать не более чем {{ limit }} вариантов. @@ -75,7 +75,7 @@ Значение должно быть {{ limit }} или меньше. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Значение слишком длинное. Должно быть равно {{ limit }} символу или меньше.|Значение слишком длинное. Должно быть равно {{ limit }} символам или меньше.|Значение слишком длинное. Должно быть равно {{ limit }} символам или меньше. @@ -83,7 +83,7 @@ Значение должно быть {{ limit }} или больше. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Значение слишком короткое. Должно быть равно {{ limit }} символу или больше.|Значение слишком короткое. Должно быть равно {{ limit }} символам или больше.|Значение слишком короткое. Должно быть равно {{ limit }} символам или больше. @@ -179,7 +179,7 @@ Значение должно быть текущим паролем пользователя. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Значение должно быть равно {{ limit }} символу.|Значение должно быть равно {{ limit }} символам.|Значение должно быть равно {{ limit }} символам. @@ -203,15 +203,15 @@ Расширение PHP вызвало ошибку при загрузке. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Эта коллекция должна содержать {{ limit }} элемент или больше.|Эта коллекция должна содержать {{ limit }} элемента или больше.|Эта коллекция должна содержать {{ limit }} элементов или больше. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Эта коллекция должна содержать {{ limit }} элемент или меньше.|Эта коллекция должна содержать {{ limit }} элемента или меньше.|Эта коллекция должна содержать {{ limit }} элементов или меньше. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Эта коллекция должна содержать ровно {{ limit }} элемент.|Эта коллекция должна содержать ровно {{ limit }} элемента.|Эта коллекция должна содержать ровно {{ limit }} элементов. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf index e57a7eca49..e2055d7503 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sk.xlf @@ -23,11 +23,11 @@ Táto hodnota by mala byť jednou z poskytnutých možností. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Mali by ste vybrať minimálne {{ limit }} možnosti. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Mali by ste vybrať najviac {{ limit }} možnosti. @@ -75,7 +75,7 @@ Táto hodnota by mala byť {{ limit }} alebo menej. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovať najviac {{ limit }} znakov. @@ -83,7 +83,7 @@ Táto hodnota by mala byť viac ako {{ limit }}. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Táto hodnota nemá dostatočný počet znakov. Minimálny počet znakov je {{ limit }}. @@ -179,7 +179,7 @@ Táto hodnota by mala byť aktuálne heslo používateľa. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Táto hodnota by mala mať presne {{ limit }} znakov. @@ -203,15 +203,15 @@ Rozšírenie PHP zabránilo nahraniu súboru. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Táto kolekcia by mala obsahovať aspoň {{ limit }} prvok alebo viac.|Táto kolekcia by mala obsahovať aspoň {{ limit }} prvky alebo viac.|Táto kolekcia by mala obsahovať aspoň {{ limit }} prvkov alebo viac. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Táto kolekcia by mala maximálne {{ limit }} prvok.|Táto kolekcia by mala obsahovať maximálne {{ limit }} prvky.|Táto kolekcia by mala obsahovať maximálne {{ limit }} prvkov. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Táto kolekcia by mala obsahovať presne {{ limit }} prvok.|Táto kolekcia by mala obsahovať presne {{ limit }} prvky.|Táto kolekcia by mala obsahovať presne {{ limit }} prvkov. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf index 1cc8921c4e..b68be59d18 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf @@ -23,11 +23,11 @@ Vrednost naj bo ena izmed podanih možnosti. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Izberite vsaj {{ limit }} možnosti. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Izberete lahko največ {{ limit }} možnosti. @@ -75,7 +75,7 @@ Vrednost mora biti manjša od {{ limit }}. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Vpisana vrednost je predolga. Največja dolžina je {{ limit }} znakov. @@ -83,7 +83,7 @@ Vpisana vrednost naj vsebuje vsaj {{ limit }} znakov. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Vpisana vrednost je prekratka. Vpišite vsaj {{ limit }} znakov. @@ -179,7 +179,7 @@ Vrednost bi morala biti trenutno uporabnikovo geslo. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Vrednost bi morala imeti točno {{ limit }} znakov. @@ -203,15 +203,15 @@ Nalaganje ni uspelo (razlog: PHP extension). - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Ta zbirka bi morala vsebovati {{ limit }} ali več elementov. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Ta zbirka bi morala vsebovati {{ limit }} ali manj elementov. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Ta zbirka bi morala vsebovati točno {{ limit }} element.|Ta zbirka bi morala vsebovati točno {{ limit }} elementa.|Ta zbirka bi morala vsebovati točno {{ limit }} elemente.|Ta zbirka bi morala vsebovati točno {{ limit }} elementov. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf index 690ad20863..e6190fca11 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf @@ -23,11 +23,11 @@ Vlera që keni zgjedhur nuk është alternativë e vlefshme. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Duhet të zgjedhni së paku {{ limit }} alternativa.|Duhet të zgjedhni së paku {{ limit }} alternativa. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Duhet të zgjedhni më së shumti {{ limit }} alternativa.|Duhet të zgjedhni më së shumti {{ limit }} alternativa. @@ -75,7 +75,7 @@ Kjo vlerë duhet të jetë {{ limit }} ose më pak. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Kjo vlerë është shumë e gjatë. Duhet t'i ketë {{ limit }} ose më pak karaktere.|Kjo vlerë është shumë e gjatë. Duhet t'i ketë {{ limit }} ose më pak karaktere. @@ -83,7 +83,7 @@ Kjo vlerë duhet të jetë {{ limit }} ose më shumë. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Kjo vlerë është shumë e shkurtër. Duhet t'i ketë {{ limit }} ose më shumë karaktere.|Kjo vlerë është shumë e shkurtër. Duhet t'i ketë {{ limit }} ose më shumë karaktere. @@ -179,7 +179,7 @@ Kjo vlerë duhet të jetë fjalëkalimi aktual i përdoruesit. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Kjo vlerë duhet të ketë saktësisht {{ limit }} karaktere.|Kjo vlerë duhet të ketë saktësisht {{ limit }} karaktere. @@ -203,15 +203,15 @@ Një ekstenzion i PHP-së bëri të dështojë ngarkimi i files. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente.|Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente.|Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Ky kolekcion duhet të përmbajë saktësisht {{ limit }} elemente.|Ky kolekcion duhet të përmbajë saktësisht {{ limit }} elemente. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf index 3e558f9dfa..d85a3d9b26 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf @@ -23,11 +23,11 @@ Вредност треба да буде једна од понуђених. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Изаберите бар {{ limit }} могућност.|Изаберите бар {{ limit }} могућности.|Изаберите бар {{ limit }} могућности. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Изаберите највише {{ limit }} могућност.|Изаберите највише {{ limit }} могућности.|Изаберите највише {{ limit }} могућности. @@ -75,7 +75,7 @@ Вредност треба да буде {{ limit }} или мање. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Вредност је предугачка. Треба да има {{ limit }} карактер или мање.|Вредност је предугачка. Треба да има {{ limit }} карактера или мање.|Вредност је предугачка. Треба да има {{ limit }} карактера или мање. @@ -83,7 +83,7 @@ Вредност треба да буде {{ limit }} или више. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Вредност је прекратка. Треба да има {{ limit }} карактер или више.|Вредност је прекратка. Треба да има {{ limit }} карактера или више.|Вредност је прекратка. Треба да има {{ limit }} карактера или више. @@ -179,7 +179,7 @@ Вредност треба да буде тренутна корисничка лозинка. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Вредност треба да има тачно {{ limit }} карактер.|Вредност треба да има тачно {{ limit }} карактера.|Вредност треба да има тачно {{ limit }} карактера. @@ -203,15 +203,15 @@ PHP екстензија је проузроковала неуспех отпремања датотеке. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Ова колекција треба да садржи {{ limit }} или више елемената.|Ова колекција треба да садржи {{ limit }} или више елемената.|Ова колекција треба да садржи {{ limit }} или више елемената. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Ова колекција треба да садржи {{ limit }} или мање елемената.|Ова колекција треба да садржи {{ limit }} или мање елемената.|Ова колекција треба да садржи {{ limit }} или мање елемената. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Ова колекција треба да садржи тачно {{ limit }} елемент.|Ова колекција треба да садржи тачно {{ limit }} елемента.|Ова колекција треба да садржи тачно {{ limit }} елемената. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf index 81d134861b..28d23dbbb5 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf @@ -23,11 +23,11 @@ Vrednost treba da bude jedna od ponuđenih. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Izaberite bar {{ limit }} mogućnost.|Izaberite bar {{ limit }} mogućnosti.|Izaberite bar {{ limit }} mogućnosti. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Izaberite najviše {{ limit }} mogućnost.|Izaberite najviše {{ limit }} mogućnosti.|Izaberite najviše {{ limit }} mogućnosti. @@ -75,7 +75,7 @@ Vrednost treba da bude {{ limit }} ili manje. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Vrednost je predugačka. Treba da ima {{ limit }} karakter ili manje.|Vrednost je predugačka. Treba da ima {{ limit }} karaktera ili manje.|Vrednost je predugačka. Treba da ima {{ limit }} karaktera ili manje. @@ -83,7 +83,7 @@ Vrednost treba da bude {{ limit }} ili više. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Vrednost je prekratka. Treba da ima {{ limit }} karakter ili više.|Vrednost je prekratka. Treba da ima {{ limit }} karaktera ili više.|Vrednost je prekratka. Treba da ima {{ limit }} karaktera ili više. @@ -179,7 +179,7 @@ Vrednost treba da bude trenutna korisnička lozinka. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Vrednost treba da ima tačno {{ limit }} karakter.|Vrednost treba da ima tačno {{ limit }} karaktera.|Vrednost treba da ima tačno {{ limit }} karaktera. @@ -203,15 +203,15 @@ PHP ekstenzija je prouzrokovala neuspeh otpremanja datoteke. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Ova kolekcija treba da sadrži {{ limit }} ili više elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili više elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili više elemenata. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Ova kolekcija treba da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili manje elemenata. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Ova kolekcija treba da sadrži tačno {{ limit }} element.|Ova kolekcija treba da sadrži tačno {{ limit }} elementa.|Ova kolekcija treba da sadrži tačno {{ limit }} elemenata. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf index 8383e508cf..f66926fea6 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sv.xlf @@ -23,11 +23,11 @@ Värdet ska vara ett av de givna valen. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Du måste välja minst {{ limit }} val.|Du måste välja minst {{ limit }} val. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Du kan som mest välja {{ limit }} val.|Du kan som mest välja {{ limit }} val. @@ -75,7 +75,7 @@ Värdet ska vara {{ limit }} eller mindre. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Värdet är för långt. Det ska ha {{ limit }} tecken eller färre.|Värdet är för långt. Det ska ha {{ limit }} tecken eller färre. @@ -83,7 +83,7 @@ Värdet ska vara {{ limit }} eller mer. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Värdet är för kort. Det ska ha {{ limit }} tecken eller mer.|Värdet är för kort. Det ska ha {{ limit }} tecken eller mer. @@ -179,7 +179,7 @@ Värdet ska vara användarens nuvarande lösenord. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Värdet ska ha exakt {{ limit }} tecken.|Värdet ska ha exakt {{ limit }} tecken. @@ -203,17 +203,17 @@ En PHP extension gjorde att uppladdningen misslyckades. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Den här samlingen ska innehålla {{ limit }} element eller mer.|Den här samlingen ska innehålla {{ limit }} element eller mer. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Den här samlingen ska innehålla {{ limit }} element eller mindre.|Den här samlingen ska innehålla {{ limit }} element eller mindre. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Den här samlingen ska innehålla exakt {{ limit }} element.|Den här samlingen ska innehålla exakt {{ limit }} element. - \ No newline at end of file + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf index 4b05ba2c80..d2f3984fed 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf @@ -23,11 +23,11 @@ Seçtiğiniz değer geçerli bir seçenek değil. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. En az {{ limit }} seçenek belirtmelisiniz. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. En çok {{ limit }} seçenek belirtmelisiniz. @@ -75,7 +75,7 @@ Bu değer {{ limit }} ve altında olmalıdır. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Bu değer çok uzun. {{ limit }} karakter veya daha az olmalıdır. @@ -83,7 +83,7 @@ Bu değer {{ limit }} veya daha fazla olmalıdır. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Bu değer çok kısa. {{ limit }} karakter veya daha fazla olmaldır. @@ -179,7 +179,7 @@ Bu değer kullanıcının şu anki şifresi olmalıdır. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Bu değer tam olarak {{ limit }} karakter olmaldır. @@ -203,15 +203,15 @@ Bir PHP eklentisi dosyanın yüklemesini başarısız kıldı. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Bu derlem {{ limit }} veya daha çok eleman içermelidir - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Bu derlem {{ limit }} veya daha az eleman içermelidir - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Bu derlem {{ limit }} eleman içermelidir diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf index 02afcd4209..91bb7b9922 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf @@ -23,11 +23,11 @@ Обране вами значення недопустиме. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. Ви повинні обрати хоча б {{ limit }} варіант.|Ви повинні обрати хоча б {{ limit }} варіанти.|Ви повинні обрати хоча б {{ limit }} варіантів. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. Ви повинні обрати не більше ніж {{ limit }} варіантів @@ -75,7 +75,7 @@ Значення повинно бути {{ limit }} або менше. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. Значення занадто довге. Повинно бути рівне {{ limit }} символу або менше.|Значення занадто довге. Повинно бути рівне {{ limit }} символам або менше.|Значення занадто довге. Повинно бути рівне {{ limit }} символам або менше. @@ -83,7 +83,7 @@ Значення повинно бути {{ limit }} або більше. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. Значення занадто коротке. Повинно бути рівне {{ limit }} символу або більше.|Значення занадто коротке. Повинно бути рівне {{ limit }} символам або більше.|Значення занадто коротке. Повинно бути рівне {{ limit }} символам або більше. @@ -179,7 +179,7 @@ Значення має бути поточним паролем користувача. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. Значення повиино бути рівним {{ limit }} символу.|Значення повиино бути рівним {{ limit }} символам.|Значення повиино бути рівним {{ limit }} символам. @@ -203,15 +203,15 @@ Розширення PHP викликало помилку при завантаженні. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. Ця колекція повинна містити {{ limit }} елемент чи більше.|Ця колекція повинна містити {{ limit }} елемента чи більше.|Ця колекція повинна містити {{ limit }} елементів чи більше. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. Ця колекція повинна містити {{ limit }} елемент чи менше.|Ця колекція повинна містити {{ limit }} елемента чи менше.|Ця колекція повинна містити {{ limit }} елементов чи менше. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. Ця колекція повинна містити рівно {{ limit }} елемент.|Ця колекція повинна містити рівно {{ limit }} елемента.|Ця колекція повинна містити рівно {{ limit }} елементів. @@ -224,4 +224,4 @@ - \ No newline at end of file + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf index 1130fa8e11..8bad4fb45f 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.zh_CN.xlf @@ -23,11 +23,11 @@ 选定变量的值不是有效的选项. - You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. 您至少要选择 {{ limit }} 个选项. - You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. 您最多能选择 {{ limit }} 个选项. @@ -75,7 +75,7 @@ 这个变量的值应该小于或等于 {{ limit }}. - This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. 字符串太长, 长度不可超过 {{ limit }} 个字符. @@ -83,7 +83,7 @@ 该变量的值应该大于或等于 {{ limit }}. - This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. 字符串太短, 长度不可少于 {{ limit }} 个字符. @@ -179,7 +179,7 @@ 该变量应为用户当前的密码. - This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. 该变量应为 {{ limit }} 个字符. @@ -203,15 +203,15 @@ 某个PHP扩展造成上传失败. - This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. 该集合最少应包含 {{ limit }} 个元素. - This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. 该集合最多包含 {{ limit }} 个元素. - This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. 该集合应包含正好 {{ limit }} 个元素element. From e00e5ecf4e65126da9994e6ffd17be09d52d29c8 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 18 Dec 2012 12:13:58 +0100 Subject: [PATCH 09/12] [Validator] Fixed failing test --- src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php b/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php index 1bbb33e26f..2868f57a82 100644 --- a/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php @@ -459,6 +459,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $violations = new ConstraintViolationList(array( // generated by the root object new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', @@ -467,6 +468,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase ), // nothing generated by the reference! new ConstraintViolation( + 'Failed', 'Failed', array(), 'Root', From cd662ccf7a7d29f0ed15c8fd6a0c2033fd14d709 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 8 Jan 2013 15:20:14 +0100 Subject: [PATCH 10/12] [Validator] Added ExceptionInterface, BadMethodCallException and InvalidArgumentException --- src/Symfony/Component/Validator/CHANGELOG.md | 1 + .../Component/Validator/DefaultTranslator.php | 8 ++++--- .../Exception/BadMethodCallException.php | 21 +++++++++++++++++++ .../Exception/ExceptionInterface.php | 21 +++++++++++++++++++ .../Exception/InvalidArgumentException.php | 21 +++++++++++++++++++ 5 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 src/Symfony/Component/Validator/Exception/BadMethodCallException.php create mode 100644 src/Symfony/Component/Validator/Exception/ExceptionInterface.php create mode 100644 src/Symfony/Component/Validator/Exception/InvalidArgumentException.php diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index b0f47b233b..fa26425aef 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -38,6 +38,7 @@ CHANGELOG * [BC BREAK] added `setTranslator()` and `setTranslationDomain()` to `ValidatorBuilderInterface` * improved the Validator to support pluralized messages by default * [BC BREAK] changed the source of all pluralized messages in the translation files to the pluralized version + * added ExceptionInterface, BadMethodCallException and InvalidArgumentException 2.1.0 ----- diff --git a/src/Symfony/Component/Validator/DefaultTranslator.php b/src/Symfony/Component/Validator/DefaultTranslator.php index c46856752d..455729bc16 100644 --- a/src/Symfony/Component/Validator/DefaultTranslator.php +++ b/src/Symfony/Component/Validator/DefaultTranslator.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator; +use Symfony\Component\Validator\Exception\BadMethodCallException; +use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Translation\TranslatorInterface; /** @@ -43,7 +45,7 @@ class DefaultTranslator implements TranslatorInterface } if (!isset($ids[1])) { - throw new \InvalidArgumentException(sprintf('The message "%s" cannot be pluralized, because it is missing a plural (e.g. "There is one apple|There are %%count%% apples").', $id)); + throw new InvalidArgumentException(sprintf('The message "%s" cannot be pluralized, because it is missing a plural (e.g. "There is one apple|There are %%count%% apples").', $id)); } return strtr($ids[1], $parameters); @@ -54,7 +56,7 @@ class DefaultTranslator implements TranslatorInterface */ public function setLocale($locale) { - throw new \BadMethodCallException('Unsupported method.'); + throw new BadMethodCallException('Unsupported method.'); } /** @@ -62,6 +64,6 @@ class DefaultTranslator implements TranslatorInterface */ public function getLocale() { - throw new \BadMethodCallException('Unsupported method.'); + throw new BadMethodCallException('Unsupported method.'); } } diff --git a/src/Symfony/Component/Validator/Exception/BadMethodCallException.php b/src/Symfony/Component/Validator/Exception/BadMethodCallException.php new file mode 100644 index 0000000000..939161bff3 --- /dev/null +++ b/src/Symfony/Component/Validator/Exception/BadMethodCallException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base BadMethodCallException for the Validator component. + * + * @author Bernhard Schussek + */ +class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface +{ +} diff --git a/src/Symfony/Component/Validator/Exception/ExceptionInterface.php b/src/Symfony/Component/Validator/Exception/ExceptionInterface.php new file mode 100644 index 0000000000..77d09b9029 --- /dev/null +++ b/src/Symfony/Component/Validator/Exception/ExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base ExceptionInterface for the Validator component. + * + * @author Bernhard Schussek + */ +interface ExceptionInterface +{ +} diff --git a/src/Symfony/Component/Validator/Exception/InvalidArgumentException.php b/src/Symfony/Component/Validator/Exception/InvalidArgumentException.php new file mode 100644 index 0000000000..22da39bb26 --- /dev/null +++ b/src/Symfony/Component/Validator/Exception/InvalidArgumentException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base InvalidArgumentException for the Validator component. + * + * @author Bernhard Schussek + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} From 58bfd60b0fdc24328cac5f43e360dce500fa6c73 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 8 Jan 2013 15:20:50 +0100 Subject: [PATCH 11/12] [Validator] Improved the inline documentation of DefaultTranslator --- .../Component/Validator/DefaultTranslator.php | 108 +++++++++++++++++- 1 file changed, 103 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Validator/DefaultTranslator.php b/src/Symfony/Component/Validator/DefaultTranslator.php index 455729bc16..7c38cbbb6b 100644 --- a/src/Symfony/Component/Validator/DefaultTranslator.php +++ b/src/Symfony/Component/Validator/DefaultTranslator.php @@ -19,14 +19,57 @@ use Symfony\Component\Translation\TranslatorInterface; * Simple translator implementation that simply replaces the parameters in * the message IDs. * - * Does not support translation domains or locales. + * Example usage: + * + * $translator = new DefaultTranslator(); + * + * echo $translator->trans( + * 'This is a {{ var }}.', + * array('{{ var }}' => 'donkey') + * ); + * + * // -> This is a donkey. + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 3, + * array('{{ count }}' => 'three') + * ); + * + * // -> These are three donkeys. + * + * This translator does not support message catalogs, translation domains or + * locales. Instead, it implements a subset of the capabilities of + * {@link \Symfony\Component\Translation\Translator} and can be used in places + * where translation is not required by default but should be optional. * * @author Bernhard Schussek */ class DefaultTranslator implements TranslatorInterface { /** - * {@inheritdoc} + * Interpolates the given message. + * + * Parameters are replaced in the message in the same manner that + * {@link strtr()} uses. + * + * Example usage: + * + * $translator = new DefaultTranslator(); + * + * echo $translator->trans( + * 'This is a {{ var }}.', + * array('{{ var }}' => 'donkey') + * ); + * + * // -> This is a donkey. + * + * @param string $id The message id + * @param array $parameters An array of parameters for the message + * @param string $domain Ignored + * @param string $locale Ignored + * + * @return string The interpolated string */ public function trans($id, array $parameters = array(), $domain = null, $locale = null) { @@ -34,7 +77,56 @@ class DefaultTranslator implements TranslatorInterface } /** - * {@inheritdoc} + * Interpolates the given choice message by choosing a variant according to a number. + * + * The variants are passed in the message ID using the format + * "|". "" is chosen if the passed $number is + * exactly 1. "" is chosen otherwise. + * + * This format is consistent with the format supported by + * {@link \Symfony\Component\Translation\Translator}, but it does not + * have the same expressiveness. While Translator supports intervals in + * message translations, which are needed for languages other than English, + * this translator does not. You should use Translator or a custom + * implementation of {@link TranslatorInterface} if you need this or similar + * functionality. + * + * Example usage: + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 0, + * array('{{ count }}' => 0) + * ); + * + * // -> These are 0 donkeys. + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 1, + * array('{{ count }}' => 1) + * ); + * + * // -> This is 1 donkey. + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 3, + * array('{{ count }}' => 3) + * ); + * + * // -> These are 3 donkeys. + * + * @param string $id The message id + * @param integer $number The number to use to find the index of the message + * @param array $parameters An array of parameters for the message + * @param string $domain Ignored + * @param string $locale Ignored + * + * @return string The translated string + * + * @throws InvalidArgumentException If the message id does not have the format + * "singular|plural". */ public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) { @@ -52,7 +144,11 @@ class DefaultTranslator implements TranslatorInterface } /** - * {@inheritdoc} + * Not supported. + * + * @param string $locale The locale + * + * @throws BadMethodCallException */ public function setLocale($locale) { @@ -60,7 +156,9 @@ class DefaultTranslator implements TranslatorInterface } /** - * {@inheritdoc} + * Not supported. + * + * @throws BadMethodCallException */ public function getLocale() { From 586a16e8f8b6a1b039465320135429c5ab155154 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Tue, 8 Jan 2013 15:27:42 +0100 Subject: [PATCH 12/12] [Validator] Changed DefaultTranslator::getLocale() to always return 'en' --- src/Symfony/Component/Validator/DefaultTranslator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Validator/DefaultTranslator.php b/src/Symfony/Component/Validator/DefaultTranslator.php index 7c38cbbb6b..c4f685e693 100644 --- a/src/Symfony/Component/Validator/DefaultTranslator.php +++ b/src/Symfony/Component/Validator/DefaultTranslator.php @@ -156,12 +156,12 @@ class DefaultTranslator implements TranslatorInterface } /** - * Not supported. + * Returns the locale of the translator. * - * @throws BadMethodCallException + * @return string Always returns 'en' */ public function getLocale() { - throw new BadMethodCallException('Unsupported method.'); + return 'en'; } }