Problem/Motivation

As experienced in #3206197: Change text on "settings" button, but with a much wider and critical scope I now found out that, the current config translation implementation mechanism in COOKiES affects global Drupal core localization translations and overrides all terms which are equal in core localization!

For example, when changing and translating group "Video" to "Media" in admin/structure/cookies_service_group afterwards in admin/config/regional/translate you see that the localization translation is globally changed!

I experienced this as I wondered why suddenly my Media Type "Video" was called "Media" *shocked*.

I didn't yet understand how exactly translations are processed in this project and perhaps that could be explained high level by the maintainer, but it seems incorrect.

I rated this as critical as it has a very large effect on the whole project and is completely unexpected in the scope of the project configuration.

Steps to reproduce

See above

Proposed resolution

Fix configuration / translation implementation.

Remaining tasks

  1. Review translation logic
  2. Check if this is a core issue effect or wrong API use
  3. Write tests
  4. Fix the implementation
  5. Release

User interface changes

None

API changes

None

Data model changes

Unclear

Comments

Anybody created an issue. See original summary.

anybody’s picture

Issue summary: View changes
jfeltkamp’s picture

Ok, I checked my code in the deep what took some hours.
Now I'm pretty sure that the issue comes from core. I referenced the issues we should keep in focus.
The translated config is mixed up with UI translations in both directions.

anybody’s picture

Thank you - any ideas how we could mitigate the risk in the meantime or work around that? Quite critical problem...

jfeltkamp’s picture

Status: Active » Postponed

I'll set this postponed and keep watching the related issues.

nimoatwoodway’s picture

I think I have the same problem:

My default language is german.

When I adjust my config, e.g. cookies.texts.yml to

langcode: de
default_langcode: de
bannerText: 'Diese Website verwendet Cookies. Einige sind für die korrekte Funktion der Website erforderlich, andere werden dazu verwendet Nutzungsdaten und Statistiken zu generieren. Bitte wähle “AKZEPTIEREN”, wenn du alle Cookies erlauben willst, oder setze die von dir gewünschten Einstellungen.'
privacyPolicy: 'Datenschutz & Impressum'
privacyUri: /node/1
imprint: ''
imprintUri: ''
cookieDocs: ''
cookieDocsUri: ''
denyAll: 'Deny all'
settings: 'Cookie Einstellungen'
acceptAll: 'Accept all'
allowAll: 'Accept all'
cookieSettings: 'Cookie Einstellungen'
close: Schließen
officialWebsite: 'Offizielle Webseite'
requiredCookies: 'Notwendige Cookies'
readMore: 'Mehr dazu'
allowed: erlauben
denied: 'nicht erlauben'
alwaysActive: 'Immer aktiv'
settingsAllServices: 'Einstellungen für alle Dienste'
saveSettings: Speichern
credit: ''
_core:
  default_config_hash: C8aQz-3d6YpwuU4QQc1iaWHb3RDkc_C9qcEsgR7HR74

Every time I install a module or run drush locale:check && drush locale:update the config get changed to this:

index 8f256ea6..1c9f4d9d 100644
--- a/config/drupal/config_export/default/cookies.texts.yml
+++ b/config/drupal/config_export/default/cookies.texts.yml
@@ -8,8 +8,8 @@ imprintUri: ''
 cookieDocs: ''
 cookieDocsUri: ''
 denyAll: 'Deny all'
-settings: Einstellungen
-acceptAll: AKZEPTIEREN
+settings: 'Cookie Einstellungen'
+acceptAll: 'Accept all'
 allowAll: 'Accept all'
 cookieSettings: 'Cookie Einstellungen'
 close: Schließen

English config file language/en/cookies.texts.yml:

default_langcode: en
bannerText: 'We use a selection of our own and third-party cookies on the pages of this website: Essential cookies, which are required in order to use the website; functional cookies, which provide better easy of use when using the website; performance cookies, which we use to generate aggregated data on website use and statistics; and marketing cookies, which are used to display relevant content and advertising. If you choose "ACCEPT ALL", you consent to the use of all cookies. You can accept and reject individual cookie types and  revoke your consent for the future at any time under "Settings".'
privacyPolicy: 'Privacy policy'
settings: 'Cookie settings'
acceptAll: 'Accept all'
allowAll: 'Accept all'
cookieSettings: 'Cookie settings'
close: Close
officialWebsite: 'View official website'
requiredCookies: 'Notwendige Cookies'
readMore: 'Read more'
allowed: allowed
denied: denied
alwaysActive: 'Always active'
settingsAllServices: 'Settings for all services'
saveSettings: Save

Changes to this:

index df5d1dcd..7e1d0197 100644
--- a/config/drupal/config_export/default/language/en/cookies.texts.yml
+++ b/config/drupal/config_export/default/language/en/cookies.texts.yml
@@ -7,7 +7,7 @@ allowAll: 'Accept all'
 cookieSettings: 'Cookie settings'
 close: Close
 officialWebsite: 'View official website'
-requiredCookies: 'Required cookies'
+requiredCookies: 'Notwendige Cookies'
 readMore: 'Read more'
 allowed: allowed
 denied: denied

Already tried to completely remove the module and it's config and reinstalled it but no improvement.

What I do not understand, we have about 30 other contrib modules where this behaviour does not accour.

My current workaround, since english is not active at moment: Give the english config the german translation. My /en/cookies.texts.yml looks like this at moment:

default_langcode: de
bannerText: 'Diese Website verwendet Cookies. Einige sind für die korrekte Funktion der Website erforderlich, andere werden dazu verwendet Nutzungsdaten und Statistiken zu generieren. Bitte wähle “AKZEPTIEREN”, wenn du alle Cookies erlauben willst, oder setze die von dir gewünschten Einstellungen.'
privacyPolicy: 'Datenschutz & Impressum'
denyAll: 'Alle ablehnen'
settings: 'Cookie Einstellungen'
acceptAll: AKZEPTIEREN
allowAll: AKZEPTIEREN
cookieSettings: 'Cookie Einstellungen'
close: Schließen
officialWebsite: 'Offizielle Webseite'
requiredCookies: 'Notwendige Cookies'
readMore: 'Mehr dazu'
allowed: erlauben
denied: 'nicht erlauben'
alwaysActive: 'Immer aktiv'
settingsAllServices: 'Einstellungen für alle Dienste'
saveSettings: Speichern

Does anyone have a better idea? Or we just have to wait before this get fixed in core?

Hopefully this helps anyone.

ericdsd’s picture

It is indeed caused by a core issue, that also impacts other modules, as wbeform or views depending on the config.
Installing a module that contains installation default config (config/install folder), generates the issue.

During installation, importing those installation config behaves like a drush config:import that would consider that all active configs have the same language as the module you're installing (english). This make non-english sites or sites with english as secondary language to mess up untranslated configs, this is specifically the case with cookie module that highly relies on translated configs.

anybody’s picture

@ericdsd: Could you please link the issue you're referring to? Or is it one of the issues marked as related?

jfeltkamp’s picture

I think this issue is the correct one.
https://www.drupal.org/project/drupal/issues/2806009

Status: Needs work

ericdsd’s picture

Sorry i didn't see your comment earlier,
i talk about several related issues
https://www.drupal.org/project/drupal/issues/2806009
https://www.drupal.org/project/drupal/issues/2905295

anybody’s picture

Version: 1.0.x-dev » 2.x-dev