Saving/Updating locale translations does not clear the cache.

Created on 30 August 2024, 3 months ago
Updated 5 September 2024, 3 months ago

Problem/Motivation

When we translate user interface strings through tmgmt it does not clear the cache. As a result, we need to manually clear the cache before the change will show up.

Note that this was originally reported in #2065823 β†’ but that was for Drupal 7 and some of that work was already committed.

Steps to reproduce

  1. Translate user interface string (t('My example string');) through tmgmt.
  2. View the translated content
  3. Observe that it does not show the text as translated.
  4. Clear the cache
  5. View the translated content
  6. Observe that it now shows the text as translated.

Proposed resolution

Call these functions in \Drupal\tmgmt_locale\Plugin\tmgmt\Source\LocalSource.php

      _locale_refresh_translations([$langcode], $updated);
      _locale_refresh_configuration([$langcode], $updated);

These are the functions being called in the core locale module.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Source: Locale

Created by

πŸ‡ΊπŸ‡ΈUnited States partdigital

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024