"Accept all cookies" button in fallback overlay translation not working

Created on 3 March 2023, over 1 year ago
Updated 19 March 2024, 3 months ago

Problem/Motivation

The "Accept All Cookies" button on fallback overlays always appears in English on multilingual sites.

Steps to reproduce

  1. Install Drupal in English
  2. Add a second language
  3. Visit /admin/config/system/cookies/texts/translate and translate the phrase "Accept All Cookies" into the second language
  4. View a page in the second language with a cookies fallback overlay. Observe "Accept All Cookies" is still in English. See screenshot.

Proposed resolution

Send the translated cookies texts to drupalSettings, instead of the untranslated texts. See patch.

🐛 Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bgreco
  • Status changed to Needs review over 1 year ago
  • Assigned to Grevil
  • 🇩🇪Germany Anybody Porta Westfalica

    @bgreco did the patch from #2 solve it for you?

    FYI: The translation and configuration fetching is kind of untypical in this module due to the react library used... So we have to check this carefully.
    @Grevil could you have a look? Best would be if @JFeltkamp could check it, but he seems lost... :(

  • @anybody Yes, it fixes the issue for me.

  • 🇨🇦Canada joseph.olstad

    same thing in 2.x

  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: Could you please take a look?

  • 🇩🇪Germany Grevil

    2.x is identical with 1.2.x and will be used for a new Vue frontend in the future.

  • Status changed to Closed: cannot reproduce 10 months ago
  • 🇩🇪Germany Grevil

    I couldn't replicate this issue.

    Steps I took:

    • Fetch current 1.2.x dev and enable the "cookies_video" module
    • Translate the "Accept All Message" with "Test" under "/admin/config/system/cookies/texts"
    • Check the output on a media field referencing a random youtube video
    • Works as expected:

  • Issue was unassigned.
  • Status changed to Postponed: needs info 10 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: Shouldn't be closed (which is a hard close for all non-maintainers). More than 1 person reported this issue and there's also a patch with a proposed fix.

    So we need clearer steps to reproduce and fix this, please. How can we see it's broken and under which conditions @bgreco and @joseph.olstad?

  • 🇩🇪Germany Grevil

    which is a hard close for all non-maintainers

    A right I forgot, my apologies.

  • @Anybody It works in a site's default language, when changing the text at /admin/config/system/cookies/texts like @Grevil did.

    It does not work in a site's non-default language, when adding additional translations at /admin/config/system/cookies/texts/translate.

  • Status changed to Needs work 10 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks for the important hint! Back to NW!

  • Status changed to RTBC 10 months ago
  • 🇩🇪Germany Grevil

    Thank you, @bgreco!

    I know that your approach works as well, but was unsure if there was a bigger meaning behind using the raw data there. But I couldn't find any. So RTBC from my side.

    • Grevil committed 2c251f21 on 1.2.x
      Issue #3345863 by bgreco, Grevil: "Accept all cookies" button in...
  • Status changed to Fixed 10 months ago
  • 🇩🇪Germany Grevil

    Works great! Fixed. :)

  • Assigned to Grevil
  • Status changed to Active 10 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil did you compare the resulting contents / array from
    getRawData()
    vs.
    get()?

    If it results in different contents within $cookiesTexts that might break other parts below?

    I'm happier with get() than with getRawData() but think we can assume there was a reason for that choice perhaps...

  • 🇩🇪Germany hexabinaer Berlin, Germany

    I am trying to trace down several "missing translation" issues, namely this one plus issues around the cookie documentation block. In multisite setup with one multilingual site, one site default German and one site default English.

    While working on my matrix I was wondering if it made sense to create one issue with an overview. Any hints on how to create a big picture that would be helpful in fixing?

  • 🇩🇪Germany hexabinaer Berlin, Germany

    For what it's worth, I just notice that - in contrast to the missing translation - the "Accept all cookies" button in fallback overlay does indeed yield the default config override (original string "Accept All Cookies", changed in default config to lowercased "Accept all cookies".

  • Issue was unassigned.
  • Status changed to Fixed 4 months ago
  • 🇩🇪Germany Grevil

    @Anybody yea I checked this a while ago, seems like I forgot to close this issue.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024