Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Closed
wants to merge 3 commits into from

Conversation

javiereguiluz
Copy link
Member

This fixes #7172.

I'm not happy with the result, so I'm open to comments to improve this. Thanks!

@bocharsky-bw
Copy link
Contributor

Sounds good for me 👍

);

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::
Copy link
Member

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 ?

@@ -255,14 +255,27 @@ To translate pluralized messages, use the

$translator->transChoice(
'There is one apple|There are %count% apples',
10,
array('%count%' => 10)
Copy link
Member

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 ?

Copy link
Contributor

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).

@HeahDude HeahDude added this to the 3.2 milestone Apr 1, 2017
@xabbuh
Copy link
Member

xabbuh commented Apr 30, 2017

👍

@xabbuh
Copy link
Member

xabbuh commented May 17, 2017

Thank you Javier.

xabbuh added a commit that referenced this pull request May 17, 2017
This PR was squashed before being merged into the 3.2 branch (closes #7205).

Discussion
----------

Simplified the use of transChoice()

This fixes #7172.

I'm not happy with the result, so I'm open to comments to improve this. Thanks!

Commits
-------

1e4e9a7 Simplified the use of transChoice()
xabbuh added a commit that referenced this pull request May 17, 2017
@xabbuh xabbuh closed this May 17, 2017
weaverryan added a commit that referenced this pull request May 20, 2017
* 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
  ...
weaverryan added a commit that referenced this pull request May 20, 2017
* 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.