You are here

protected static function LanguageConfiguration::getDefaultOptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/Element/LanguageConfiguration.php \Drupal\language\Element\LanguageConfiguration::getDefaultOptions()

Returns the default options for the language configuration form element.

Return value

array An array containing the default options.

1 call to LanguageConfiguration::getDefaultOptions()
LanguageConfiguration::processLanguageConfiguration in core/modules/language/src/Element/LanguageConfiguration.php
Process handler for the language_configuration form element.

File

core/modules/language/src/Element/LanguageConfiguration.php, line 97
Contains \Drupal\language\Element\LanguageConfiguration.

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;
}