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

Added chapter about the locale based on the user entity#4875

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

Merged
weaverryan merged 4 commits intosymfony:2.3frompeterrehm:locale-user-dependend
Mar 13, 2015
Merged

Added chapter about the locale based on the user entity#4875

weaverryan merged 4 commits intosymfony:2.3frompeterrehm:locale-user-dependend
Mar 13, 2015

Conversation

peterrehm
Copy link
Contributor

QA
Doc fix?no
New docs?yes
Applies to2.3
Fixed tickets#4862

Setting the locale based on the user entity
-------------------------------------------

You might want to improve even further and want to define the locale based on

Choose a reason for hiding this comment

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

Original:

You might want to improve even further and want to define the locale based onthe user entity of the logged in user.

Proposed rewording:

You might want to improve this technique even further and define the locale based onthe user entity of the logged in user.

@javiereguiluz
Copy link
Member

@peterrehm thanks for adding this nice addition to the cookbook. I've made lots of comments, but they are minor things about the syntax. Your contents are right and that's the important thing. Thanks!

@@ -106,3 +106,86 @@ method::
{
$locale = $request->getLocale();
}

Setting the locale based on the user entity
Copy link
Member

Choose a reason for hiding this comment

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

"Setting the Locale based on the User Entity"

@peterrehm
Copy link
ContributorAuthor

Thank you for the feedback on the chapter, I have made the adjustments based on our discussion. Let's see when@xabbuh wakes up I expect the next e-mail flood :)

@@ -106,3 +106,93 @@ method::
{
$locale = $request->getLocale();
}

Setting the Locale based on the User Entity
Copy link
Member

Choose a reason for hiding this comment

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

Based

@xabbuh
Copy link
Member

Thanks for this great work@peterrehm! I left you a few comments. :)

However, I have one thought I would like to discuss with you: I am not convinced that we should actually talk about entities at all. In fact, it doesn't really matter if the user is stored in a relation database or if you load them from a custom file format or anything else. So I'd suggest to talk about "Choosing the Locale Based on the User's Preferences" or something like that. What do you think?

@peterrehm
Copy link
ContributorAuthor

Thank you for your feedback, I was awaiting that :)

I changed it in the title to preferences, but we mainly talk about entities. I think it makes it more clear that you also have to watch out for changes to the entity as in the end in the caution block.

@peterrehm
Copy link
ContributorAuthor

I think this one is finished now?

services:
app.user_locale_listener:
class: AppBundle\EventListener\UserLocaleListener
tags:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you forget to inject the session here

...arguments:[@session]

@wouterj
Copy link
Member

Sorry,@peterrehm, I missed the update of this PR. Labelled it as finished now

@weaverryanweaverryan merged commit1aaa491 intosymfony:2.3Mar 13, 2015
weaverryan added a commit that referenced this pull requestMar 13, 2015
… (peterrehm)This PR was merged into the 2.3 branch.Discussion----------Added chapter about the locale based on the user entity| Q             | A| ------------- | ---| Doc fix?      | no| New docs?     | yes| Applies to    | 2.3| Fixed tickets |#4862Commits-------1aaa491 Updated as per feedback.0fc72a8 Updated as per feedback6e986e1 Updated wording of the chapter as per discussion66e21a9 Added chapter about the locale based on the user entity
weaverryan added a commit that referenced this pull requestMar 13, 2015
@weaverryan
Copy link
Member

Hey Peter! This is really great! I'll admit that this article sounds very useful and common, but I'm not sure I would have known how to implement it immediately. So, awesome :).

I did make some minor language tweaks at sha:4c190cf. If anyone sees any issues (I have the superpower of making more typos than everyone else), please let me know!

Thanks!

weaverryan added a commit that referenced this pull requestMar 13, 2015
* 2.3: (23 commits)  Update configuration.rst  Update configuration.rst  Readability  [#4875] Minor language tweaks  [#4779] Minor tweaks to a huge PR  Fixed some of the comments  [#4793] Very minor tweak that sounds more natural  [config][translator] use the new fallbacks option.  Linked "logrotate" to its official website  Minor rewording  Added a note about log file sizes and the use of logrotate  Use snake_case for template names  Made http cache chapter best-practices-compatible and lots of other fixes  Made propel chapter best-practices-compatible and lots of other fixes  Made testing chapter best-practices-compatible and lots of other fixes  Made validation chapter best-practices-compatible  Remove usage of first person  Updated as per feedback.  Updated as per feedback  Fix typos  ...Conflicts:book/forms.rstbook/testing.rstcookbook/logging/monolog.rstreference/configuration/framework.rst
weaverryan added a commit that referenced this pull requestMar 13, 2015
* 2.6: (32 commits)  Update configuration.rst  Update configuration.rst  Readability  [#4875] Minor language tweaks  [#4779] Minor tweaks to a huge PR  [#4724] Minor language tweaks and cross-link to form theming  document the validation payload option  Fixed some of the comments  [#4793] Very minor tweak that sounds more natural  [#4732] Tweaking language, clarifying purpose of disabling form and that you can disable CSRF on 1 form  [#4732] Tweaking language, clarifying purpose of disabling form and that you can disable CSRF on 1 form  [config][translator] use the new fallbacks option.  add missing reference options and descriptions  Linked "logrotate" to its official website  Minor rewording  Added a note about log file sizes and the use of logrotate  Use snake_case for template names  Fixed minor grammar issues  Made http cache chapter best-practices-compatible and lots of other fixes  Made propel chapter best-practices-compatible and lots of other fixes  ...
weaverryan added a commit that referenced this pull requestMar 13, 2015
* 2.7: (38 commits)  Update configuration.rst  Update configuration.rst  Readability  [#4875] Minor language tweaks  [#4779] Minor tweaks to a huge PR  [#4724] Minor language tweaks and cross-link to form theming  [Serializer] Fix CS  document the validation payload option  Fixed some of the comments  [#4793] Very minor tweak that sounds more natural  [#4732] Tweaking language, clarifying purpose of disabling form and that you can disable CSRF on 1 form  [#4732] Tweaking language, clarifying purpose of disabling form and that you can disable CSRF on 1 form  [config][translator] use the new fallbacks option.  add missing reference options and descriptions  Linked "logrotate" to its official website  Minor rewording  Added a note about log file sizes and the use of logrotate  Use snake_case for template names  Fixed minor grammar issues  Made http cache chapter best-practices-compatible and lots of other fixes  ...
@xabbuh
Copy link
Member

@peterrehm@weaverryan Sadly, I missed a few minor issues (see#5081).

@peterrehmpeterrehm deleted the locale-user-dependend branchMay 24, 2016 06:46
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.

6 participants
@peterrehm@javiereguiluz@xabbuh@wouterj@weaverryan@aitboudad

[8]ページ先頭

©2009-2025 Movatter.jp