orestbida / cookieconsent

:cookie: Simple cross-browser cookie-consent plugin written in vanilla js
https://playground.cookieconsent.orestbida.com/
MIT License
3.68k stars 388 forks source link

[Bug]: `CookieConsent.setLanguage` not working #608

Closed jackdeguest closed 6 months ago

jackdeguest commented 6 months ago

Expected Behavior

I expect the cookies consent preference to be using the language specified in argument to CookieConsent.setLanguage, such as: CookieConsent.setLanguage("en")

Current Behavior

Currently, calling CookieConsent.setLanguage has no effect on the language of the cookies settings pane, or the notification pane.

Steps to reproduce

  1. Ensure your browser language is in another language than en-GB
  2. Execute CookieConsent.setLanguage("en"); CookieConsent.showPreferences();
  3. The settings pane will still be displayed in whatever is your web browser preferred language and not the one specified with setLanguage

Proposed fix or additional info.

No response

Version

v3.0.0-rc.17

On which browser do you see the issue?

Firefox

orestbida commented 6 months ago

Just like #607, this also works fine on my end. Please provide a demo with the issue.

jackdeguest commented 6 months ago

I could pinpoint the source of the error here as well, and it was my mistake. I was declaring the language files en-GB, fr-FR and ja-JP, but I was calling CookieConsent.setLanguage('ja',true);

You can close this issue.