Skip to content

Commit

Permalink
refactor: change param name to language
Browse files Browse the repository at this point in the history
  • Loading branch information
Amirsz01 committed Jul 28, 2024
1 parent a2e9b23 commit 754579f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/OpenStreetMapAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface Props {
placeholder?: string;
noOptionName?: string;
openStreetMapUrl?: string;
localization?: string;
language?: string;
value: OpeenStreetMap | null;
classes?: OpenStreetMapAutocompleteStyle<string>;
styles?: OpenStreetMapAutocompleteStyle<CSSProperties>;
Expand Down Expand Up @@ -63,7 +63,7 @@ export function OpenStreetMapAutocomplete({
placeholder = 'Search',
noOptionName = 'No locations found',
openStreetMapUrl = 'https://nominatim.openstreetmap.org',
localization = 'en',
language = 'en',
}: Props) {
const [isActive, setActive] = useState(false);
const inputRef = useRef<HTMLInputElement>(null);
Expand Down Expand Up @@ -109,7 +109,7 @@ export function OpenStreetMapAutocomplete({
const getGeocoding = useCallback(
(address = '') => {
if (!address) return;
const url = `${openStreetMapUrl}/search?format=json&accept-language=${localization}&q=${address}`;
const url = `${openStreetMapUrl}/search?format=json&accept-language=${language}&q=${address}`;

fetch(url)
.then((response) => response.json())
Expand All @@ -125,7 +125,7 @@ export function OpenStreetMapAutocomplete({
)
.catch(() => setOptions([]));
},
[openStreetMapUrl, localization]
[openStreetMapUrl, language]
);

useEffect(() => {
Expand Down

0 comments on commit 754579f

Please sign in to comment.