-
Notifications
You must be signed in to change notification settings - Fork 141
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
Locale property is not working? #56
Comments
Sorry but that is pretty inappropriate, to close and mark the issue as invalid w/o any explanation or further discution... |
https://developers.google.com/identity/gsi/web/reference/js-reference#locale
Maybe the user account has a strong preference that google respects. |
From the Google side, the user account has not a strong preference, so the BTW, the Edit, I did some testing (making sure to hard reload):
So, my theory about
seems pretty much incorrect. I have no idea why it works on some people but it doesn't for some others. |
any update? |
doesnt work for me too |
Hey guys! I have ran into this issue as well
I have found a workaround to get around it for now This works perfectly for me, so feel free to use it. In the meantime, I'll try to open a PR to this repo to fix the issue globally const onScriptLoaded = () => {
document.body.removeChild(document.querySelector('[src="https://accounts.google.com/gsi/client"]'));
const scriptTag = document.createElement('script');
scriptTag.src = `https://accounts.google.com/gsi/client?hl=${locale}`;
scriptTag.onload = () => {
setIsReady(true);
};
document.body.appendChild(scriptTag);
};
return (
<div ref={ref}>
<GoogleOAuthProvider
clientId={googleSignInToken}
onScriptLoadSuccess={onScriptLoaded}
>
{isReady && <GoogleLogin {...props} />}
</GoogleOAuthProvider>
</div>
); |
To be honest I'm not sure if I am doing something wrong but it seems that the
locale
property of the theGoogleLogin
component isn't working, in your and in the google documentation is stated that:locale: string
, e.g. "zh_CN", but even the example isn't working.Is this the case or I miss understhood something?
The text was updated successfully, but these errors were encountered: