Skip to content

Refactor Request object documentation and redefine method logic #19780

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

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

Spomky
Copy link
Contributor

@Spomky Spomky commented Apr 11, 2024

Fixes #19748

The documentation for the Request object in the controller documentation has been updated to be more specific. The logic of the getPreferredLanguage method has been updated and clarified in Symfony 7.1. An additional step has been added which accounts for languages that match the locale, but exhibit a different script or region. The Response Object section has been moved for better flow and readability.

The documentation for the Request object in the controller documentation has been updated to be more specific. The logic of the `getPreferredLanguage` method has been updated and clarified in Symfony 7.1. An additional step has been added which accounts for languages that match the locale, but exhibit a different script or region. The Response Object section has been moved for better flow and readability.
@javiereguiluz javiereguiluz changed the base branch from 7.1 to 6.4 April 12, 2024 14:49
@javiereguiluz javiereguiluz force-pushed the features/similar-locale branch from b76f69f to 99df757 Compare April 12, 2024 14:49
@javiereguiluz javiereguiluz merged commit 618573d into symfony:6.4 Apr 12, 2024
@javiereguiluz
Copy link
Member

Florent, thanks a lot for this contribution. However, I changed it a lot while merging it.

On 6.4 branch:

  • I removed these contents from controller.rst and moved them to a new section in translation.rst
  • I added a short example of using the method and passing the array of arguments for clarity
  • I removed the detailed list that explains all the steps run internally by this method. Your original content is perfectly correct ... but while merging it I realized that it was too detailed. It describes the internal code almost line by line. So, I reworded the entire behavior as a short phrase.

See a293225

On 7.1 branch:

  • I reworded the explanation to mention that in addition to "perfect match" now Symfony also tries "partial match" based on the language part of the locale

See d0fd14b

I'm sorry I changed your contribution so much. We usually only tweak users' contributions ... but this time I felt like we had to make more changes. Sorry!

@Spomky
Copy link
Contributor Author

Spomky commented Apr 12, 2024

Thank you @javiereguiluz.
One question though: why 6.4? The PR was merged in 7.1.

@javiereguiluz
Copy link
Member

javiereguiluz commented Apr 12, 2024

Yes, I missed something in my previous comment: I merged it in 6.4 (but not the 7.1 addition) because in the docs we were really missing this explanation about preferred languages.

@Spomky
Copy link
Contributor Author

Spomky commented Apr 12, 2024

Cristal clear. No problem.
Juss tell me if you want me to add anything else.

@Spomky Spomky deleted the features/similar-locale branch April 12, 2024 15:54
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.

[HttpFoundation] Similar locale selection
3 participants