react-google-maps-api icon indicating copy to clipboard operation
react-google-maps-api copied to clipboard

StandaloneSearchBox - Translating loading text

Open bdubetink opened this issue 6 months ago • 0 comments

Hi,

I am using the StandaloneSearchBox component in my react application. While the application load, before the input is render, we see for like .25 or .5 seconde the word "Loading...".

I have looked in documentation and on google and I can't find how is it possible to translate this text. My app is available in two language.

The component is use as children of the LoadScript component. I see there is a language props for the LoadScript component, but whatever I put in the language props it's making no change.

This is how the components are used :

<LoadScript
      googleMapsApiKey={`${apiKey}&loading=async`}
      libraries={libraries}
    >
      <StandaloneSearchBox
        onLoad={(ref) => (inputRef.current = ref)}
        onPlacesChanged={handleLocationChanged}
      >
        <input
          ref={autocompleteInputRef}
          type="text"
          className="location-autocomplete-input text-body-sm"
          placeholder={t("step1.filters.locplaceholder")}
          value={formikProps.values.location}
          onChange={(e) => {
            handleLocationEmpty(e);
          }}
        />
    </StandaloneSearchBox>
</LoadScript>

Your Environment

os: windows

node --version 18.8.0

react version 18.2.0

webpack version 5.90.0

@babel version 7.24.3

@react-google-maps/api version 2.19.3

Basic implementation of incorrect behavior in codesandbox.com : https://codesandbox.io/p/sandbox/relaxed-bardeen-cgdcyc

bdubetink avatar Jul 31 '24 20:07 bdubetink