Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LocaleConfigManager.php

function LocaleConfigManager::getActiveConfigLangcode

Returns the current language code for this active configuration.

Parameters

string $name: The configuration name.

Return value

null|string Language code of the current active configuration for $name. If the configuration data for $name did not contain a language code, it is assumed to be English. The return value is NULL if no such active configuration exists.

1 call to LocaleConfigManager::getActiveConfigLangcode()
LocaleConfigManager::updateConfigTranslations in core/modules/locale/src/LocaleConfigManager.php
Updates all configuration translations for the names / languages provided.

File

core/modules/locale/src/LocaleConfigManager.php, line 514

Class

LocaleConfigManager
Manages configuration supported in part by interface translation.

Namespace

Drupal\locale

Code

public function getActiveConfigLangcode($name) {
    $active = $this->configStorage
        ->read($name);
    if (!empty($active)) {
        return !empty($active['langcode']) ? $active['langcode'] : 'en';
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal