Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LanguageNegotiation.php

function LanguageNegotiation::mapNewMethods

Maps old negotiation method names to the new ones.

Parameters

string $value: The old negotiation method name.

Return value

string The new negotiation method name.

1 call to LanguageNegotiation::mapNewMethods()
LanguageNegotiation::transform in core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php
Performs the associated process.

File

core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php, line 60

Class

LanguageNegotiation
Processes the arrays for the language types' negotiation methods and weights.

Namespace

Drupal\language\Plugin\migrate\process

Code

protected function mapNewMethods($value) {
    switch ($value) {
        case 'language-default':
            return 'language-selected';
        case 'locale-browser':
            return 'language-browser';
        case 'locale-interface':
            return 'language-interface';
        case 'locale-session':
            return 'language-session';
        case 'locale-url':
            return 'language-url';
        case 'locale-url-fallback':
            return 'language-url-fallback';
        case 'locale-user':
            return 'language-user';
        default:
            return $value;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal