diff --git a/core/includes/language.inc b/core/includes/language.inc index 2bfdc31..43e837e 100644 --- a/core/includes/language.inc +++ b/core/includes/language.inc @@ -13,6 +13,11 @@ const LANGUAGE_NEGOTIATION_SELECTED = 'language-selected'; /** + * The language is determined using the current interface language. + */ +const LANGUAGE_NEGOTIATION_INTERFACE = 'language-interface'; + +/** * @defgroup language_negotiation Language Negotiation API functionality * @{ * Functions to customize the language types and the negotiation process. @@ -170,7 +175,10 @@ function language_types_info() { */ function language_types_get_configurable() { $configurable = &drupal_static(__FUNCTION__); - return isset($configurable) ? $configurable : array_keys(array_filter(config('system.language.types')->get('configurable'))); + if (!isset($configurable)) { + $configurable = array_keys(array_filter(config('system.language.types')->get('configurable'))); + } + return $configurable; } /** @@ -202,7 +210,6 @@ function language_types_disable($types) { * configuration. */ function language_types_set($configurable) { - include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'language') . '/language.negotiation.inc'; // Ensure that we are getting the defined language negotiation information. An // invocation of module_enable() or module_disable() could outdate the cached // information. @@ -212,12 +219,12 @@ function language_types_set($configurable) { $language_types = array(); $negotiation_info = language_negotiation_info(); foreach (language_types_info() as $type => $info) { - // Check if the language is locked. Configurability of a locked language - // type cannot be change using the UI. + // Check if the language is locked. The configuration of a locked language + // type cannot be changed using the UI. if ($locked = !empty($info['locked'])) { // If a locked language has default settings (by using the 'fixed' - // property) it will be always configurable. If it doesn't have any - // default setting, then it won't be configurable. + // property) it will be always configurable. If it has no default + // settings, then it won't be configurable. $configurable[$type] = empty($info['fixed']); $language_types[$type] = !$locked; if (!$configurable[$type]) { @@ -231,7 +238,7 @@ function language_types_set($configurable) { } } else { - // Configurability of an unlocked language will be based on the + // The configuration of an unlocked language will be based on the // $configurable array (stored in configuration). These values may be // altered using the UI. $language_types[$type] = !empty($configurable[$type]); diff --git a/core/modules/language/language.negotiation.inc b/core/modules/language/language.negotiation.inc index ca41c78..4e29e47 100644 --- a/core/modules/language/language.negotiation.inc +++ b/core/modules/language/language.negotiation.inc @@ -18,11 +18,6 @@ const LANGUAGE_NEGOTIATION_BROWSER = 'language-browser'; /** - * The language is determined using the current interface language. - */ -const LANGUAGE_NEGOTIATION_INTERFACE = 'language-interface'; - -/** * If no URL language, language is determined using an already detected one. */ const LANGUAGE_NEGOTIATION_URL_FALLBACK = 'language-url-fallback';