Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

GregoireHebert
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tickets ~
License MIT
Doc PR ~

@GregoireHebert GregoireHebert changed the title WIP: Add translation system WIP: Use Accept-Language to select the locale Nov 12, 2020
use Symfony\Component\Routing\RequestContextAwareInterface;

/**
* Choose the locale to use according to the Accept-Language header
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Choose the locale to use according to the Accept-Language header
* Chooses the locale to use according to the Accept-Language header

private $router;
private $resourceMetadataFactory;

public function __construct(ResourceMetadataFactoryInterface $resourceMetadataFactory, RequestContextAwareInterface $router = null, array $defaultEnabledLocales = [])
Copy link
Member

Choose a reason for hiding this comment

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

In my opinion, this listener belongs in Symfony. /cc @nicolas-grekas

Copy link
Contributor

Choose a reason for hiding this comment

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

this has been rejected in symfony/symfony#36507, isn't it?
(the arguments against it would apply to this PR btw ;) )

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand the arguments against. It's opt-in (so it cannot be a security vulnerability, the linked one is not related), it's a core feature of HTTP and it's very useful for APIs.

Base automatically changed from master to main January 23, 2021 21:59
@maxhelias
Copy link
Contributor

Fixed in symfony/symfony#43108

@alanpoulain
Copy link
Member

We should add the correct default configuration in API Platform then!

@stale
Copy link

stale bot commented Nov 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 4, 2022
@stale
Copy link

stale bot commented Jan 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 3, 2023
@stale stale bot closed this Jan 10, 2023
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.

5 participants