How to Manually Set the Language for Zaraz Cookie Consent Modal?

For Workers & Pages, what is the name of the domain?

whydonate.in

What is the error number?

0

What is the issue or error you’re encountering

I’m using Cloudflare Zaraz for cookie consent management. Whenever I manually open the consent modal using zaraz.showConsentModal(), it automatically picks the browser’s language or locale. However, I need to override this behavior and specify a language manually when opening the modal. Is there a way to pass a language parameter to zaraz.showConsentModal() or any workaround to force it to open in a specific language?

What steps have you taken to resolve the issue?

I’m using Cloudflare Zaraz for cookie consent management. Whenever I manually open the consent modal using zaraz.showConsentModal(), it automatically picks the browser’s language or locale. However, I need to override this behavior and specify a language manually when opening the modal.

Is there a way to pass a language parameter to zaraz.showConsentModal() or any workaround to force it to open in a specific language?

Hi,

Thank you for reaching out to us. You may refer to the following: Enable the Consent Management platform (CMP) · Cloudflare Zaraz docs

By default, the Zaraz Consent Management Platform will try to match the language of the consent modal with the language requested by the browser, using the Accept-Language HTTP header. If, for any reason, you would like to force the consent modal language to a specific one, you can use the zaraz.set Web API to define the default __zarazConsentLanguage value.

Below is an example that forces the language shown to be American English.

zaraz.set(‘__zarazConsentLanguage’, ‘en-US’)

Next steps

If the default consent modal does not suit your website’s design, you can use the Custom CSS tool to add your own custom design.