Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Update translation.rst#4989

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
solazs wants to merge82 commits intosymfony:2.6fromsolazs:patch-1
Closed

Update translation.rst#4989

solazs wants to merge82 commits intosymfony:2.6fromsolazs:patch-1

Conversation

solazs
Copy link
Contributor

Clarify that changing the locale in the controller would not affect template rendering as the translator reads the request locale during the kernel.request event.

weaverryanand others added30 commitsNovember 5, 2014 11:55
…m option (egeloen)This PR was merged into the master branch.Discussion----------[Form] Add entity manager instance support for em optionThis PR documentssymfony/symfony#12251Commits-------09a6fd7 [Form] Add entity manager instance support for em option
…onent (weaverryan, nicolas-grekas)This PR was merged into the master branch.Discussion----------[symfony#4243] Tweaks to the new var-dumper component| Q             | A| ------------- | ---| Doc fix?      | yes| New docs?     | no| Applies to    | 2.6| Fixed tickets | noneHi guys!This follows aftersymfony#4243 - the best way to review it was to merge, read from scratch, and make these final tweaks. As always, I've certainly made some mistakes, so I appreciate the review.Thanks!Commits-------1a29f24 typos in the var-dumper component265604b [symfony#4243] Tweaks to the new var-dumper component
* 2.7:  typos in the var-dumper component  [symfony#4243] Tweaks to the new var-dumper component  [Form] Add entity manager instance support for em option  [symfony#4336] Backporting minor syntax fix  Included a bunch of fixes suggested by the awesome Symfony doc reviewers  Added a bunch of fixes suggested by@xabbuh  Fixed a RST formatting issue  Revamped the Quick Start tutorial  tweaks tosymfony#4427  Updated first code-block:: bash
* 2.7:  separate table columns with two spaces  consistent table headlines
* 2.7: (22 commits)  Fix up the final sentence to be a bit cleaner.  SetDescription required on Product entities  typo fix  Fixed typo  Modifying the best practice to use form_start() instead of <form  Proposing that we make the service names *just* a little bit longer  fix elseif statement  Added a reference to the Bootstrap 3 form theme  remove versionadded directives for old versions  Fixed wrong indentation  Bot fixes  refer to the VarDumper component for dump()  tweaks to the Twig reference  Removed unnecessary use statement in code example in the debugging cookbook  [Form] document $deep and $flatten of getErrors()  describe how to access form errors  Changed userName to username  Update slash_in_parameter.rst  Applied suggestion by Ryan  Update form_customization.rst  ...
* 2.7:  Yet another typo fix  Applied fixes  Applied comments  Typo fix  Use new factory syntax  link to a bundle's current (not master) docs  Documented new tags  Documented expressionlanguage extensibility  Documented html5 option  Renamed empty_value to placeholder
* 2.7:  Fixing build error  Big update based on feedback from xabbuh and WouterJ  Moving forwarding section all the way to the bottom  Completely re-reading the controller chapter
* 2.7:  Removing bad period
* 2.7:  Updating the installer docs to exactly match that repository's README - seesymfony#4533  Add command to make symfony.phar executable.  fixed little typo
* 2.7: (45 commits)  Front-porting changes by@pborreli insymfony#4531  Fixed typos  Update web_server_configuration.rst  Update web_server_configuration.rst  Added two missing pulls  Added November changelog  Added November changelog  Added November changelog  Updated documentation regarding the SecurityContext split;symfony/symfony#11690  Adding tiny note  changing line breaks to be shorter, no real change  [symfony#4050] Backporting some additions to 2.3  added logging  to translator.  Missing attribute 'original'  remove service class parameters  Fixes concat operator typo  Incorporates@wouterj 's suggestion for more realistic usage of bang  Changes operator spacing language  Adds missing space before return statement  Fixes spelling and formatting errors  ...
* 2.7:  Use the new build env on Travis  required PHPUnit version in the docs should be updated to 4.2 (or later) since the atLeast() method which is used in some of the tests  Reverts a commit to 2.3 for 2.4 features. This re-adds them to the 2.5 branch  Fixing bad merge  Replace form_enctype(form) with form_start(form).  Remove ExpressionLanguage reference for 2.3 version
* 2.7:  [symfony#4625] Removing link added for BC, because this is the top of the page anyways  Added '-ing' title ending to unify titles look  [OptionsResolver] Fix namespace  [OptionsResolver] Fix Namespace link  filesystem headlines match method names  Change refering block name from content to body  Update pdo_session_storage.rst  When explaining how to install dependencies for running unit tests, there are references to "--dev" composer parameter that is the current default value.  Fixing missing services key  readd mistakenly removed label  fix feature freeze dates
* 2.7: (35 commits)  Update forms.rst  link to the API documentation  Re-wording parameters.yml section and removing note about vendorsymfony#4608  [symfony#4608] Using #. for numbered bullets  Changing and -> or based on conversation insymfony#4532  Changed to definition lists from Book section  Changed to definition lists  Fixed heading capitalization to follow the standards  Changed paragraph to heading  Changed unordered list to definition list  Spelling mistake tens to tons  Removed double `firewall_restriction` entry  Normalize the method listings on version 2.5  Update controllers.rst  Update the_controller.rst  replace Symfony2 with Symfony  Linked the PDO/DBAL Session article from the Doctrine category  Fix indentation of YAML example  Fixed some code indentation  Matching up the index position with the map  ...
* 2.7:  Replaced a "note" by a "seealso"  Imrpoved the wording of the note about using using legacy PHP 5.3 version  Reworded the reasons why you should use Composer-based installation  Wrapped a line to follow doc standards  Display the same version number on Linux and Windows to avoid confusions  Add an explicit command to better explain that we recommend to move symfony.phar to projects directory  Reworded a confusing phrase  Added a note about verifying Symfony digital signatures  Re-added a wrongly deleted link reference  Rewritten from scratch the chapter about installing Symfony
* 2.7:  Fix for symfony code standards  Refsymfony#3903 - Normalize methods listings  drop varnish 2 example from varnish cookbook article  Rewrite the varnish cookbook article  Fixes and tweaks  Change PHPUnit link to avoid redirect to homepage  Harmonize PHPUnit version to 4.2 or above  Remove redundant "default" connection.  More tweaks and grammar fixes  Rewordings and transformed a list into a definition list  More grammar fixes  Minor grammar fix  Fixed some errors in the explanation  Documented the console environment variables  Changed the "new in Symfony 2.6" message for consistency  Documented getProgress/setProgress methods  update ordered list syntax  Add  missing autoload include in basic application example  Added cache_busting to default asset config
* 2.7:  Update map.rst.inc  Coding standard for PHP block.  Fix coding standardssymfony#2  Use alphabetical order.  Fix duplicated references.  Add some references.  Reference available services  Better match Symfony documentation standard.  Github => GitHub  Fix typo and add Github link.  Deploy Symfony application on Platform.sh.
* 2.7:  Fixes thanks to comments and a new note about the LegacyPdoSessionHandler  Fix typo: than in Twig => than Twig templates  use a global Composer installation  Completed the needed context to successfully test commands  add validation config reference section  Some more fixes after proofreading  Fixes incorrect latin abbrev  Some general grammar and style fixes in the book  Updating statements, now that we're not overriding the names  Adding details about the changes to the PdoSessionHandler in 2.6
* 2.7:  [symfony#4606] Getting my XML (and PHP) on in the new security chapter  [symfony#4606] Tweaks thanks entirely to stof  Changing to _ for consistency  [symfony#4606] Updating thanks to comments from everyone!  Completely re-reading the security book  Misc changes  [Cookbook] Fix XML example of RTE
* 2.7:  removing duplicate key  Updating one more reference of security.context that I missed in the merge  [Security] Removed deprecated example about SecurityContext  Use denyAccessUnlessGranted shortcut  Use new security.authorization_checker service
* 2.7:  Fixing build error  Fixing build error
wouterjand others added5 commitsFebruary 1, 2015 15:57
Conflicts:changelog.rst
* 2.6:  [symfony#4928] Backporting change after merging into 2.5 (since 2.3 is a little different)  Update introduction.rst  Change installation method order  Fix typos  Add missing comma in array  Fix typos  Fix typos  Remove block which doesn't make sense after best practices  Fixed a minor RST syntax issue  Added a reference about including JS and CSS files in PHP templates  Removed the Stable API chapter from the Symfony book
* 2.7:  [symfony#4928] Backporting change after merging into 2.5 (since 2.3 is a little different)  Update introduction.rst  Change installation method order  Fix typos  Add missing comma in array  Fix typos  Fix typos  Remove block which doesn't make sense after best practices  Fixed a minor RST syntax issue  Added a reference about including JS and CSS files in PHP templates  Removed the Stable API chapter from the Symfony book
Clarify that changing the locale in the controller would not affect template rendering as the translator reads the request locale during the kernel.request event.

Setting the locale using ``$request->setLocale()`` won't affect rendering
in the same action as the translator reads the request locale during the
kernel.request event, so changing it here would be too late. To manually
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is a really long sentence, let's break it up. Something among the lines of:

Setting the locale using the ``$request->setLocale()`` method does not affectrendering in the same action. The translator locale is set during the ``kernel.request``event. Either change the locale before the listener is called or use the ``setLocale()``method of the ``translator`` service.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks, I'm commiting the changes soon.


Setting the locale using the ``$request->setLocale()`` method won't affect
rendering in the same action. The translator locale is set during the
kernel.request event. Either set the locale before the listener is called
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

sorry, one more thing before I'll label it as "finished": Could you please putkernel.request in a literal (double backticks) as well?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

sure thing

@wouterj
Copy link
Member

👍 Thanks!

@xabbuh
Copy link
Member

👍

rendering in the same action. The translator locale is set during the
``kernel.request`` event. Either set the locale before the listener is called
(e.g. in a custom listener) or use the ``setLocale()`` method of the
``translator`` service.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is a really great point and thing to add. But I think showing the$request->setLocale() above is misleading. Itdoes serve to highlight that this method exists, which is good, but as we point out, setting the locale won't actually work.

Are there downsides to setting the locale directly on the translator from the controller? Or do we think this is kind of hackish? If it is hackish (it seems so to me, but I also can't think of a real downside), then I think we should:

  • Remove the setLocale in the code block above
  • Add another code block showing an event listener that is calling setLocale, and just mention quickly that this would be an event listener onkernel.request, with a link to the event listener sections.

What do you all think?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It does feel hackish, but I can't really see why it shouldn't be done this way. It works perfectly and I could not find any other way to change the local of the translator in the controller.

I believe it feels hackish, because the translator service is normally not accessed, so this means another depency. This shouldn't cause any problems though.

  • Remove the setLocale in the code block above
  • Add another code block showing an event listener that is calling setLocale, and just mention quickly that this would be an event listener on kernel.request, with a link to the event listener sections.

This is a great idea! I'll sketch a new version as soon as I can and push it, see if you like it.

@weaverryanweaverryan mentioned this pull requestMar 20, 2015
@weaverryan
Copy link
Member

Thanks@solazs! I reworded a few things, but I think this is a very very nice addition - thanks for the PR! I'm closing this, but will merge#5099 with my extra commits in about 1 minute.

Cheers!

weaverryan added a commit that referenced this pull requestMar 20, 2015
This PR was submitted for the 2.6 branch but it was merged into the 2.3 branch instead (closes#5099).Discussion----------Rebase of#4989Just a PR after rebasing#4989, which had some extra commits.This will be committed to the 2.3 branch.Commits-------006303d Moving index down to correct section7281c53 [#4989] Language tweaks and making the example simpler1ad8122 Remove useless setLocale() call and add code block with locale setter43b2098 Finaly touches on translation locale setting note79f5865 Review note about setting the translator locale in a controller.3b136c8 Update translation.rst
weaverryan added a commit that referenced this pull requestMar 24, 2015
* 2.3: (44 commits)  Removed duplicate "long"s  terminate file with newline  move title back and move description to separate file as suggested in PR#4892  move title out of included file as suggested in PR#4892  Add possible values for widget_type  [#4842] Making 2 sentences  changes as suggested by WouterJ in pull request#4842  Add meaning of yellow icon for number of queries  Fixing bad link name  fix typo in event flow diagrams  Many fixes thanks to stof, WouterJ, xabbuh and dupuchba  added Jakub as a merger for the DomCrawler component  [#5094] Removing mkdir - it's not needed (thanks xabbuh)  some tweaks to#4601  Moving index down to correct section  [#4989] Language tweaks and making the example simpler  Remove useless setLocale() call and add code block with locale setter  Finaly touches on translation locale setting note  Review note about setting the translator locale in a controller.  Update translation.rst  ...Conflicts:cookbook/security/entity_provider.rst
weaverryan added a commit that referenced this pull requestMar 24, 2015
* 2.6: (45 commits)  Removed duplicate "long"s  terminate file with newline  move title back and move description to separate file as suggested in PR#4892  move title out of included file as suggested in PR#4892  Add possible values for widget_type  [#4842] Making 2 sentences  changes as suggested by WouterJ in pull request#4842  Add meaning of yellow icon for number of queries  Fixing bad link name  fix typo in event flow diagrams  Many fixes thanks to stof, WouterJ, xabbuh and dupuchba  added Jakub as a merger for the DomCrawler component  [#5094] Removing mkdir - it's not needed (thanks xabbuh)  some tweaks to#4601  Moving index down to correct section  [#4989] Language tweaks and making the example simpler  Remove useless setLocale() call and add code block with locale setter  Finaly touches on translation locale setting note  Review note about setting the translator locale in a controller.  Update translation.rst  ...
weaverryan added a commit that referenced this pull requestMar 24, 2015
* 2.7: (47 commits)  Removed duplicate "long"s  terminate file with newline  move title back and move description to separate file as suggested in PR#4892  move title out of included file as suggested in PR#4892  Add possible values for widget_type  [#4842] Making 2 sentences  changes as suggested by WouterJ in pull request#4842  Add meaning of yellow icon for number of queries  Fixing bad link name  fix typo in event flow diagrams  Many fixes thanks to stof, WouterJ, xabbuh and dupuchba  added Jakub as a merger for the DomCrawler component  Changes thanks to WouterJ and xabbuh  [#5094] Removing mkdir - it's not needed (thanks xabbuh)  some tweaks to#4601  Moving index down to correct section  [#4989] Language tweaks and making the example simpler  Remove useless setLocale() call and add code block with locale setter  Finaly touches on translation locale setting note  Review note about setting the translator locale in a controller.  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@solazs@wouterj@xabbuh@weaverryan@GeLoLabs@nicolas-grekas@peterrehm@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp