Skip to content
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

Google user set locale coalesce if null #22

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Conversation

timmess
Copy link
Contributor

@timmess timmess commented Aug 29, 2024

No description provided.

@timmess timmess force-pushed the hotfix/fix-google-user-locale branch from 1dc17ff to f271960 Compare August 30, 2024 10:02
private static function getLocale(GoogleUser $googleUser): string
{
if (null === $googleUser->getLocale()) {
return 'fr_FR';
Copy link
Member

Choose a reason for hiding this comment

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

Can you use current locale ?

use Sylius\Component\Locale\Context\LocaleContextInterface;
...
public function __construct(private LocaleContextInterface $localeContext) {}

and

Suggested change
return 'fr_FR';
return $this->localeContext->getLocaleCode();

@timmess timmess force-pushed the hotfix/fix-google-user-locale branch from 998454a to 3bee759 Compare September 12, 2024 08:52
@oallain oallain merged commit c47c27d into main Nov 20, 2024
11 checks passed
@oallain oallain deleted the hotfix/fix-google-user-locale branch November 20, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants