-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Simplified the use of transChoice() #7205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Sounds good for me 👍 |
components/translation/usage.rst
Outdated
); | ||
|
||
The second argument (``10`` in this example) is the *number* of objects being | ||
described and is used to determine which translation to use and also to populate | ||
the ``%count%`` placeholder. | ||
|
||
.. note:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this use a ..versionadded
directive ?
components/translation/usage.rst
Outdated
@@ -255,14 +255,27 @@ To translate pluralized messages, use the | ||
|
||
$translator->transChoice( | ||
'There is one apple|There are %count% apples', | ||
10, | ||
array('%count%' => 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you still have any example passing other placeholders to transchoice ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the translator
page has a first section about this (http://symfony.com/doc/2.7/components/translation/usage.html#message-placeholders).
👍 |
Thank you Javier. |
* 3.2: (39 commits) updating instance Avoid backticks in shell scripts Update optional_dependencies.rst Fix xml blocks pass only strings to loadUserByUsername() Fix Authenticator Class (getCredentials) example Documented addAnnotatedClassesToCompile() and the use of class patterns Added the picture that shows how GuardAuthenticationListener calls Authentication Guard methods. [#7205] minor tweak Simplified the use of transChoice() [#7875] minor tweaks Minor fix Minor changes Properly show all events and describe guard events [#7891] remove not needed sentence [#7773] fix line length Add helpful remarks on custom DataCollector Remove use of deprecated security.exception_listener.class parameter Update resources.rst Fix incoherent ut8mb4 collation in Doctrine setup ...
* 3.4: (40 commits) Adding an article to explain the 3.3 changes, and how to upgrade updating instance Avoid backticks in shell scripts Update optional_dependencies.rst Fix xml blocks pass only strings to loadUserByUsername() Fix Authenticator Class (getCredentials) example Documented addAnnotatedClassesToCompile() and the use of class patterns Added the picture that shows how GuardAuthenticationListener calls Authentication Guard methods. [#7205] minor tweak Simplified the use of transChoice() [#7875] minor tweaks Minor fix Minor changes Properly show all events and describe guard events [#7891] remove not needed sentence [#7773] fix line length Add helpful remarks on custom DataCollector Remove use of deprecated security.exception_listener.class parameter Update resources.rst ...
This fixes #7172.
I'm not happy with the result, so I'm open to comments to improve this. Thanks!