okfn/opendataday

Cookie consent translation

loleg opened this issue · 3 comments

loleg commented

The cookie pop-up banner is currently in English only, and loaded from an external static dependency which does not make it possible to translate the text. This is not only important messaging, we should also offer a no tracking choice. I would suggest switching to a more robust consent plugin.

loleg commented

Ah, good! But that's not the script currently used on the opendataday.org site.

pyrog commented

Sure ? 😉

When exploring the code of the online page https://opendataday.org one could read:

<head>
  <meta charset="utf-8">
  <title>You are invited — Open Data Day</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700" rel="stylesheet">
  <link rel="stylesheet" href="css/style.css">
  <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css" rel="stylesheet">
  <script id="cookieconsent-core" async="" type="text/javascript"
    src="https://a.okfn.org/html/oki/consent/assets/js/cookieconsent.min.js">
  </script>
  <script>
    var okiConsent = {
      analyticsTrackingID: 'UA-33874954-12',
    };
  </script>
  <script src="https://a.okfn.org/html/oki/consent/assets/js/consent.js"></script>
  <link id="cookieconsent-css" rel="stylesheet" type="text/css"
    href="https://a.okfn.org/html/oki/consent/assets/css/cookieconsent.min.css" media="screen">
  <style></style>
</head>

But you are right, the line calling cookieconsent.min.js is not in the source code 🤔

<head>
<meta charset="utf-8">
<title>{% block title %}Welcome{% endblock %} — Open Data Day</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700" rel="stylesheet">
<link rel="stylesheet" href="{{ '/css/style.css'|url }}">
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css" rel="stylesheet" />
<script>
var okiConsent = {
analyticsTrackingID: 'UA-33874954-12',
};
</script>
<script src="https://a.okfn.org/html/oki/consent/assets/js/consent.js"></script>
</head>

Anyway, the following message is hardcoded in https://github.com/okfn/a/blob/master/a/html/oki/consent/assets/js/consent.js#L98-L104
Cookie consent message