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

Breadcrumb

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

function Request::setPhpDefaultLocale

2 calls to Request::setPhpDefaultLocale()
Request::setDefaultLocale in vendor/symfony/http-foundation/Request.php
Sets the default locale.
Request::setLocale in vendor/symfony/http-foundation/Request.php
Sets the locale.

File

vendor/symfony/http-foundation/Request.php, line 1927

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

private function setPhpDefaultLocale(string $locale) : void {
    // if either the class Locale doesn't exist, or an exception is thrown when
    // setting the default locale, the intl module is not installed, and
    // the call can be ignored:
    try {
        if (class_exists(\Locale::class, false)) {
            \Locale::setDefault($locale);
        }
    } catch (\Exception) {
    }
}

API Navigation

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