Hoa central
Public Member Functions | List of all members
Hoa\Locale\Localizer\System Class Reference
Inheritance diagram for Hoa\Locale\Localizer\System:

Public Member Functions

 getLocale ()
 

Detailed Description

Class .

Deduce locale from the system.

Definition at line 47 of file System.php.

Member Function Documentation

Hoa\Locale\Localizer\System::getLocale ( )

Get locale.

Returns
string

Implements Hoa\Locale\Localizer\Localizer.

Definition at line 54 of file System.php.

55  {
56  foreach (explode('/', setlocale(LC_ALL, 0)) as $locale) {
57  if ('C' !== $locale) {
58  break;
59  }
60  }
61 
62  if ('C' === $locale) {
63  return null;
64  }
65 
66  return str_replace(
67  '_',
68  '-',
69  substr($locale, 0, strpos($locale, '.') ?: strlen($locale))
70  );
71  }

The documentation for this class was generated from the following file: