You are here

function hook_language_fallback_candidates_alter in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/language.api.php \hook_language_fallback_candidates_alter()
  2. 7 modules/system/language.api.php \hook_language_fallback_candidates_alter()

Allow modules to alter the language fallback candidates.

Parameters

array $candidates: An array of language codes whose order will determine the language fallback order.

array $context: A language fallback context.

See also

\Drupal\Core\Language\LanguageManagerInterface::getFallbackCandidates()

Related topics

1 function implements hook_language_fallback_candidates_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

language_test_language_fallback_candidates_alter in core/modules/language/tests/language_test/language_test.module
Implements hook_language_fallback_candidates_alter().

File

core/modules/language/language.api.php, line 91
Hooks provided by the Language module.

Code

function hook_language_fallback_candidates_alter(array &$candidates, array $context) {
  $candidates = array_reverse($candidates);
}