This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bridge/Twig
Fabien Potencier cc833b13b6 merged branch hason/validator (PR #552)
Commits
-------

f9a486e [Validator] Added support for pluralization of the SizeLengthValidator
c0715f1 [FrameworkBundle], [TwigBundle] added support for form error message pluralization
7a6376e [Form] added support for error message pluralization
345981f [Validator] added support for plural messages

Discussion
----------

[Validator] Added support for plural error messages

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Todo: create translations for en and update others (FrameworkBundle)

[![Build Status](https://secure.travis-ci.org/hason/symfony.png?branch=validator)](http://travis-ci.org/hason/symfony)

---------------------------------------------------------------------------

by fabpot at 2011-05-14T20:41:01Z

@bschussek: What's your opinion?

---------------------------------------------------------------------------

by stof at 2011-09-04T13:14:29Z

@hason could you rebase your branch on top of master and update the PR ?

You also need to change the messages in the constraint that uses the pluralization to a pluralized format.

---------------------------------------------------------------------------

by stof at 2011-10-16T18:06:22Z

@hason ping

---------------------------------------------------------------------------

by stof at 2011-11-11T14:58:19Z

@hason ping again

---------------------------------------------------------------------------

by stof at 2011-12-12T20:39:10Z

@hason ping again. Can you update your PR ?

---------------------------------------------------------------------------

by hason at 2011-12-12T21:29:14Z

@stof I hope that I will update PR this week.

---------------------------------------------------------------------------

by bschussek at 2012-01-15T19:07:32Z

Looks good to me.

---------------------------------------------------------------------------

by canni at 2012-02-02T17:28:54Z

@hason can you update this PR and squash commits, it conflicts with current master

---------------------------------------------------------------------------

by hason at 2012-02-09T07:21:41Z

@stof, @canni Rebased.

What is the best solution for the translation of messages?

1. Change messages in the classes and all xliff files?
2. Keep messages in the classes and change all xliff files?

---------------------------------------------------------------------------

by stof at 2012-02-09T08:19:41Z

The constraints contain the en message so you will need to modify them to update the message

---------------------------------------------------------------------------

by hason at 2012-02-09T08:55:55Z

I prefer second option. The Validator component should be decoupled from the Translation component. The constraints contain the en message which is also the key for Translation component. We should create validators.en.xlf in the FrameworkBundle for en message. I think that this is better solution. What do you think?

---------------------------------------------------------------------------

by stof at 2012-04-04T02:22:02Z

@hason Please rebase your branch. It conflicts with master because of the move of the tests

@fabpot ping
2012-04-11 16:12:39 +02:00
..
Extension [TwigBundle] fixed CS 2012-04-07 01:24:57 -03:00
Node [Form] Alternate syntax for form_theme 2012-03-13 14:48:30 +01:00
NodeVisitor [TwigBridge] added a way to specify a default domain for a Twig template (via the 'trans_default_domain' tag) 2012-01-02 17:48:19 +01:00
Resources/views/Form merged branch hason/validator (PR #552) 2012-04-11 16:12:39 +02:00
Tests [TwigBridge] updated TestCase as an abstract class 2012-04-07 18:49:17 -03:00
TokenParser [Form] Alternate syntax for form_theme 2012-03-13 14:48:30 +01:00
Translation [TwigBridge] rewrote the Twig translation extractor 2011-09-23 09:38:20 +02:00
composer.json [TwigBridge] updated suggested packages 2012-04-08 03:12:14 -03:00
phpunit.xml.dist moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00
README.md [TwigBridge] fixed bootstrap 2012-04-07 18:47:00 -03:00
TwigEngine.php fixed CS 2012-04-07 09:10:50 +02:00

Twig Bridge

Provides integration for Twig with various Symfony2 components.

Resources

You can run the unit tests with the following command:

phpunit -c src/Symfony/Bridge/Twig/

If you also want to run the unit tests that depend on other Symfony Components, declare the following environment variables before running PHPUnit:

export TWIG=../path/to/Twig
export SYMFONY_EVENT_DISPATCHER=../path/to/EventDispatcher
export SYMFONY_FORM=../path/to/Form
export SYMFONY_LOCALE=../path/to/Locale
export SYMFONY_TEMPLATING=../path/to/Templating
export SYMFONY_TRANSLATION=../path/to/Translation