function locale_translation_status_delete_languages

Same name in other branches
  1. 9 core/modules/locale/locale.module \locale_translation_status_delete_languages()
  2. 8.9.x core/modules/locale/locale.module \locale_translation_status_delete_languages()
  3. 10 core/modules/locale/locale.module \locale_translation_status_delete_languages()

Delete language entries from the status cache.

Parameters

array $langcodes: Language code(s) to be deleted from the cache.

1 call to locale_translation_status_delete_languages()
LocaleHooks::configurableLanguageDelete in core/modules/locale/src/Hook/LocaleHooks.php
Implements hook_ENTITY_TYPE_delete() for 'configurable_language'.

File

core/modules/locale/locale.module, line 626

Code

function locale_translation_status_delete_languages($langcodes) {
    if ($status = locale_translation_get_status()) {
        foreach ($status as $project => $languages) {
            foreach ($languages as $langcode => $source) {
                if (in_array($langcode, $langcodes)) {
                    unset($status[$project][$langcode]);
                }
            }
            \Drupal::keyValue('locale.translation_status')->set($project, $status[$project]);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.