function locale_translation_batch_version_check

Same name and namespace in other branches
  1. 10 core/modules/locale/locale.batch.inc \locale_translation_batch_version_check()
  2. 11.x core/modules/locale/locale.batch.inc \locale_translation_batch_version_check()

Implements callback_batch_operation().

Checks for changed project versions, and cleans-up data from the old version. For example when a module is updated. This will make the translation import system use translations that match the current version.

Parameters

string $project: Machine name of the project for which to check the translation status.

string $langcode: Language code of the language for which to check the translation.

array|\ArrayAccess $context: The batch context.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(LocaleFetch::class)->batchVersionCheck() instead.

See also

https://www.drupal.org/node/3589759

File

core/modules/locale/locale.batch.inc, line 38

Code

function locale_translation_batch_version_check(string $project, string $langcode, array|\ArrayAccess &$context) : void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \\Drupal::service(LocaleFetch::class)->batchVersionCheck() instead. See https://www.drupal.org/node/3589759', E_USER_DEPRECATED);
  \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
  \Drupal::service(LocaleFetch::class)->batchVersionCheck($project, $langcode, $context);
}

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