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

Breadcrumb

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

function TranslatorTrait::getLocale

1 call to TranslatorTrait::getLocale()
TranslatorTrait::trans in vendor/symfony/translation-contracts/TranslatorTrait.php

File

vendor/symfony/translation-contracts/TranslatorTrait.php, line 33

Class

TranslatorTrait
A trait to help implement TranslatorInterface and LocaleAwareInterface.

Namespace

Symfony\Contracts\Translation

Code

public function getLocale() : string {
    return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en');
}
RSS feed
Powered by Drupal