function locale_translation_status_delete_languages

Same name in other branches
  1. 8.9.x core/modules/locale/locale.module \locale_translation_status_delete_languages()
  2. 10 core/modules/locale/locale.module \locale_translation_status_delete_languages()
  3. 11.x 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()
locale_configurable_language_delete in core/modules/locale/locale.module
Implements hook_ENTITY_TYPE_delete() for 'configurable_language'.

File

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

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.