diff --git a/core/lib/Drupal/Core/Language/LanguageDefault.php b/core/lib/Drupal/Core/Language/LanguageDefault.php index b1b7102b3a0add574e9985b0c46cb5a5e2f538f7..a72b8b1552f753bf574123a6213609627ff900e2 100644 --- a/core/lib/Drupal/Core/Language/LanguageDefault.php +++ b/core/lib/Drupal/Core/Language/LanguageDefault.php @@ -1,5 +1,10 @@ set(new Language($default_values)); + public function __construct(array $values) { + $this->set(new Language($values)); } /** diff --git a/core/lib/Drupal/Core/Language/LanguageManager.php b/core/lib/Drupal/Core/Language/LanguageManager.php index 4d86ea32a788ae2017d58f3a6279361ffde0d20c..3d943d02de927befabf0a86478cbe15dc47bbaad 100644 --- a/core/lib/Drupal/Core/Language/LanguageManager.php +++ b/core/lib/Drupal/Core/Language/LanguageManager.php @@ -50,7 +50,7 @@ public function __construct(LanguageDefault $default_language) { /** * {@inheritdoc} */ - function setTranslation(TranslationInterface $translation) { + public function setTranslation(TranslationInterface $translation) { $this->translation = $translation; } @@ -150,7 +150,7 @@ public function getLanguage($langcode) { /** * {@inheritdoc} */ - function getLanguageName($langcode) { + public function getLanguageName($langcode) { if ($langcode == Language::LANGCODE_NOT_SPECIFIED) { return $this->t('None'); } @@ -172,7 +172,7 @@ public function getDefaultLockedLanguages($weight = 0) { $locked_language = array( 'default' => FALSE, 'locked' => TRUE, - ); + ); $languages[Language::LANGCODE_NOT_SPECIFIED] = new Language(array( 'id' => Language::LANGCODE_NOT_SPECIFIED, 'name' => $this->t('Not specified'), @@ -214,9 +214,10 @@ public function getLanguageSwitchLinks($type, $path) { * Some common languages with their English and native names. * * Language codes are defined by the W3C language tags document for - * interoperability. Language codes typically have a language and optionally, - * a script or regional variant name. See - * http://www.w3.org/International/articles/language-tags/ for more information. + * interoperability. Language codes typically have a language and, optionally, + * a script or regional variant name. See: + * http://www.w3.org/International/articles/language-tags/ for more + * information. * * This list is based on languages available from localize.drupal.org. See * http://localize.drupal.org/issues for information on how to add languages @@ -332,9 +333,9 @@ public static function getStandardLanguageList() { /** * {@inheritdoc} * - * This function is a noop since the configuration can not be overridden by + * This function is a noop since the configuration cannot be overridden by * language unless the Language module is enabled. That replaces the default - * language manger with a configurable language manager. + * language manager with a configurable language manager. * * @see \Drupal\language\ConfigurableLanguageManager::setConfigOverrideLanguage() */ diff --git a/core/lib/Drupal/Core/Language/LanguageManagerInterface.php b/core/lib/Drupal/Core/Language/LanguageManagerInterface.php index e638edfa7995597b35fe2cf5de3aba6328ac704f..33e86356379b887c5bbbbf1b6cdcd7057e8602c5 100644 --- a/core/lib/Drupal/Core/Language/LanguageManagerInterface.php +++ b/core/lib/Drupal/Core/Language/LanguageManagerInterface.php @@ -17,10 +17,10 @@ interface LanguageManagerInterface { /** * Injects the string translation service. * - * @param \use Drupal\Core\StringTranslation\TranslationInterface $translation + * @param \Drupal\Core\StringTranslation\TranslationInterface $translation * The string translation service. */ - function setTranslation(TranslationInterface $translation); + public function setTranslation(TranslationInterface $translation); /** * Initializes each language type to a language object. @@ -77,17 +77,17 @@ public function reset($type = NULL); public function getDefaultLanguage(); /** - * Returns a list of languages set up on the site. - * - * @param $flags - * (optional) Specifies the state of the languages that have to be - * returned. It can be: Language::STATE_CONFIGURABLE, - * Language::STATE_LOCKED, Language::STATE_ALL. - * - * @return array - * An associative array of languages, keyed by the language code, ordered - * by weight ascending and name ascending. - */ + * Returns a list of languages set up on the site. + * + * @param int $flags + * (optional) Specifies the state of the languages that have to be returned. + * It can be: Language::STATE_CONFIGURABLE, + * Language::STATE_LOCKED, Language::STATE_ALL. + * + * @return array + * An associative array of languages, keyed by the language code, ordered + * by weight ascending and name ascending. + */ public function getLanguages($flags = Language::STATE_CONFIGURABLE); /** @@ -110,7 +110,7 @@ public function getLanguage($langcode); * @return string * The printed name of the language. */ - function getLanguageName($langcode); + public function getLanguageName($langcode); /** * Returns a list of the default locked languages. @@ -158,15 +158,15 @@ public function getFallbackCandidates($langcode = NULL, array $context = array() /** * Returns the language switch links for the given language type. * - * @param $type + * @param string $type * The language type. - * @param $path + * @param string $path * The internal path the switch links will be relative to. * * @return array * A keyed array of links ready to be themed. */ - function getLanguageSwitchLinks($type, $path); + public function getLanguageSwitchLinks($type, $path); /** * Sets the configuration override language.