How do I translate the widgets?

Do you want to translate on the fly, and in one go, all the Goodays widgets used on your web page?
Do you want to translate the survey received by email into the language of your clients?
Do you need to manage several languages on your website?

Here's how to do it!

Using a JavaScript object

Create an object called GoodaysSDK on the window object with a config attribute containing the desired configuration parameters.

window.GoodaysSDK = {
	config: {
		lang: "ru", // note we do not prefix with cz_ here
	}
};

📘

The parameter will be forwarded to each widget open on the web page.

Using GET parameters

Set GET parameters in the page url for each configuration parameter you want to set (they have to be prefixed with cz_ to be identified as a configuration parameter for our Goodays SDK).

https://gdys.co/p/N02Bfl/?cz_open=send_feedback:<place_id>&cz_lang=en

If you don't know the language used by your end customers, you can put several language codes, separated by a comma, in the cz_lang parameter, which will have the effect of asking them for their language before moving on.

https://gdys.co/p/N02Bfl/?cz_open=send_feedback:<place_id>&cz_lang=en,fr

Using HTML code

Set the lang parameter in the data_params array:

<a
   class="goodays-widget"
   href="https://app.goodays.co/widgets/<customer_name>/<place_id>"
   data-type="store_button:stars"
   data-params='{"lang":"en"}'
   > Goodays: Send feedback </a>

If you don't know the language used by your end customers, you can put several language codes, separated by a comma, in the lang parameter, which will have the effect of asking them for their language before moving on.

<a
   class="goodays-widget"
   href="https://app.goodays.co/widgets/<customer_name>/<place_id>"
   data-type="store_button:stars"
   data-params='{"lang":"en,fr"}'
   > Goodays: Send feedback </a>

📘

The three methods can be used at the same time to configure our SDK but if any parameter is set twice, configuration parameters set in the page URL will prevail upon the ones defined in the JavaScript object or the web page.

❗️

If the language code is unknown or if the requested translation does not exist in the Goodays configuration then the default language will be used: French.