LanguageConfiguration::getDefaultOptions

protected static LanguageConfiguration::getDefaultOptions()

Returns the default options for the language configuration form element.

Return value

array An array containing the default options.

File

core/modules/language/src/Element/LanguageConfiguration.php, line 91

Class

LanguageConfiguration
Provides language element configuration.

Namespace

Drupal\language\Element

Code

protected static function getDefaultOptions() {
  $language_options = array(
    LanguageInterface::LANGCODE_SITE_DEFAULT => t("Site's default language (@language)", array('@language' => static::languageManager()->getDefaultLanguage()->getName())),
    'current_interface' => t('Interface text language selected for page'),
    'authors_default' => t("Author's preferred language"),
  );

  $languages = static::languageManager()->getLanguages(LanguageInterface::STATE_ALL);
  foreach ($languages as $langcode => $language) {
    $language_options[$langcode] = $language->isLocked() ? t('- @name -', array('@name' => $language->getName())) : $language->getName();
  }

  return $language_options;
}
doc_Drupal
2016-10-29 09:22:15
Comments
Leave a Comment

Please login to continue.