comparison core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationBrowser.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
33 if ($this->languageManager && $request && $request->server->get('HTTP_ACCEPT_LANGUAGE')) { 33 if ($this->languageManager && $request && $request->server->get('HTTP_ACCEPT_LANGUAGE')) {
34 $http_accept_language = $request->server->get('HTTP_ACCEPT_LANGUAGE'); 34 $http_accept_language = $request->server->get('HTTP_ACCEPT_LANGUAGE');
35 $langcodes = array_keys($this->languageManager->getLanguages()); 35 $langcodes = array_keys($this->languageManager->getLanguages());
36 $mappings = $this->config->get('language.mappings')->get('map'); 36 $mappings = $this->config->get('language.mappings')->get('map');
37 $langcode = UserAgent::getBestMatchingLangcode($http_accept_language, $langcodes, $mappings); 37 $langcode = UserAgent::getBestMatchingLangcode($http_accept_language, $langcodes, $mappings);
38 // Internal page cache with multiple languages and browser negotiation
39 // could lead to wrong cached sites. Therefore disabling the internal
40 // page cache.
41 // @todo Solve more elegantly in https://www.drupal.org/node/2430335.
42 \Drupal::service('page_cache_kill_switch')->trigger();
43 } 38 }
39
40 // Internal page cache with multiple languages and browser negotiation
41 // could lead to wrong cached sites. Therefore disabling the internal page
42 // cache.
43 // @todo Solve more elegantly in https://www.drupal.org/node/2430335.
44 \Drupal::service('page_cache_kill_switch')->trigger();
44 45
45 return $langcode; 46 return $langcode;
46 } 47 }
47 48
48 } 49 }