diff options
Diffstat (limited to 'core/modules/locale/locale.install')
-rw-r--r-- | core/modules/locale/locale.install | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index f583df4426e..457d37890fa 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -8,72 +8,6 @@ use Drupal\Core\File\Exception\FileException; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Hook\Attribute\ProceduralHookScanStop; -use Drupal\Core\Link; -use Drupal\Core\Url; - -/** - * Implements hook_requirements(). - */ -function locale_requirements($phase): array { - $requirements = []; - if ($phase == 'runtime') { - $available_updates = []; - $untranslated = []; - $languages = locale_translatable_language_list(); - - if ($languages) { - // Determine the status of the translation updates per language. - $status = locale_translation_get_status(); - if ($status) { - foreach ($status as $project) { - foreach ($project as $langcode => $project_info) { - if (empty($project_info->type)) { - $untranslated[$langcode] = $languages[$langcode]->getName(); - } - elseif ($project_info->type == LOCALE_TRANSLATION_LOCAL || $project_info->type == LOCALE_TRANSLATION_REMOTE) { - $available_updates[$langcode] = $languages[$langcode]->getName(); - } - } - } - - if ($available_updates || $untranslated) { - if ($available_updates) { - $requirements['locale_translation'] = [ - 'title' => t('Translation update status'), - 'value' => Link::fromTextAndUrl(t('Updates available'), Url::fromRoute('locale.translate_status'))->toString(), - 'severity' => REQUIREMENT_WARNING, - 'description' => t('Updates available for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => implode(', ', $available_updates), ':updates' => Url::fromRoute('locale.translate_status')->toString()]), - ]; - } - else { - $requirements['locale_translation'] = [ - 'title' => t('Translation update status'), - 'value' => t('Missing translations'), - 'severity' => REQUIREMENT_INFO, - 'description' => t('Missing translations for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => implode(', ', $untranslated), ':updates' => Url::fromRoute('locale.translate_status')->toString()]), - ]; - } - } - else { - $requirements['locale_translation'] = [ - 'title' => t('Translation update status'), - 'value' => t('Up to date'), - 'severity' => REQUIREMENT_OK, - ]; - } - } - else { - $requirements['locale_translation'] = [ - 'title' => t('Translation update status'), - 'value' => Link::fromTextAndUrl(t('Can not determine status'), Url::fromRoute('locale.translate_status'))->toString(), - 'severity' => REQUIREMENT_WARNING, - 'description' => t('No translation status is available. See the <a href=":updates">Available translation updates</a> page for more information.', [':updates' => Url::fromRoute('locale.translate_status')->toString()]), - ]; - } - } - } - return $requirements; -} /** * Implements hook_install(). |