language_negotiation_url_prefixes_update
function language_negotiation_url_prefixes_update
language_negotiation_url_prefixes_update()
Update the list of prefixes from the installed languages.
File
- core/modules/language/language.module, line 283
- Add language handling functionality to Drupal.
Code
function language_negotiation_url_prefixes_update() { $config = \Drupal::configFactory()->getEditable('language.negotiation'); $prefixes = $config->get('url.prefixes'); foreach (\Drupal::languageManager()->getLanguages() as $language) { // The prefix for this language should be updated if it's not assigned yet // or the prefix is set to the empty string. if (empty($prefixes[$language->getId()])) { // For the default language, set the prefix to the empty string, //