ErrorPro / react-google-autocomplete

React components for google places API.
MIT License
473 stars 114 forks source link

Language setting is english but returns a different language #177

Closed illlama closed 1 year ago

illlama commented 2 years ago

Just like a bellow, search results aren't an English.

I tried to change language as korean or english or the others but the result is almost same ( I mean, US is change as I intended but del Norte part wasn't changed.)

image

And here's my code.

<StyledAutoComplete
                apiKey={process.env.GOOGLE_MAPS_API_KEY}
                onPlaceSelected={(place) =>...}
                options={{
                    types: ['administrative_area_level_1'],
                    componentRestrictions: { country: 'us' },
                }}
                language={'en'}
            />

I can't find a way to solve this problem I searched so I made an issue.

Thanks for this great library

AlexeyRDKV commented 1 year ago

The Google API uses the browser's preferred language setting when displaying textual information.

Screenshot 2022-12-09 at 21 26 52 Screenshot 2022-12-09 at 21 27 36 Screenshot 2022-12-09 at 21 29 20
lowfnm commented 2 months ago

@AlexeyRDKV but how we can sort if we wanna only en or fr for example predictions?