jfeltkamp / cookiesjsr

Easily expandable cookie consent tool.
Other
22 stars 5 forks source link

Different cookie documentation urls for different languages #1

Closed felubra closed 3 years ago

felubra commented 3 years ago

Hi, First of all, thank you for this great project. I would like to provide language based url for the cookie documentation. I believe it is best to present this documentation in the user native language if possible.

In the configuration, I think something like this:

"essential": {
      "id": "essential",
      "services": [
        {
          "key": "cloudflare",
          "type": "essential",
          "name": "Cloudflare",
          "uri": {
            "pt": "https://support.cloudflare.com/hc/pt-br/articles/200170156-Como-funcionam-os-cookies-da-Cloudflare",
            "en": "https://support.cloudflare.com/hc/en-us/articles/200170156-Understanding-the-Cloudflare-Cookies",
          },
          "needConsent": false
        }
      ]
    },

If the value of 'uri' is a string, then we should use the previous behaviour to not introduce a breaking change.

What do you think of this feature?

jfeltkamp commented 3 years ago

Do you use cookiesjsr with Drupal? In Drupal the node translation is used automatically. If you use it independent from a CMS you have to load different configs with the language id. configQuery: '/path/to/%lang_id/cookiesjsr-config.json' as documented here: https://github.com/jfeltkamp/cookiesjsr#base-config