‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Localization\Locale Class Reference
Inheritance diagram for TYPO3\CMS\Core\Localization\Locale:

Public Member Functions

 __construct (string $locale='en', array $dependencies=[])
 
 getName ()
 
 getLanguageCode ()
 
 isRightToLeftLanguageDirection ()
 
 getLanguageScriptCode ()
 
 getCountryCode ()
 
 posixFormatted ()
 
 getPosixCodeSet ()
 
 getDependencies ()
 
 __toString ()
 

Protected Member Functions

 normalize (string $locale)
 

Protected Attributes

string $locale
 
string $languageCode
 
string $languageScript = null
 
string $countryCode = null
 
string $codeSet = null
 
string $charsetModifier = null
 
const RIGHT_TO_LEFT_LANGUAGE_CODES
 
array $dependencies = []
 

Detailed Description

A representation of language key (based on ISO 639-1 / ISO 639-2)

  • ‪the optional four-letter script code that can follow the language code according to the Unicode ISO 15924 Registry (e.g. Hans in zh_Hans)
  • ‪region / country (based on ISO 3166-1) separated with a "-".

This conforms to IETF - RFC 5646 (see https://datatracker.ietf.org/doc/rfc5646/) in a simplified form.

Definition at line 29 of file Locale.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Localization\Locale::__construct ( string  $locale = 'en',
array  $dependencies = [] 
)

Only use the contructor directly if you know what you are doing and want to create custom locales with custom dependencies. Otherwise, instantiate a new Locale object via Locales->createLocale() as it deals with registered dependencies automatically.

Definition at line 70 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$charsetModifier, TYPO3\CMS\Core\Localization\Locale\$codeSet, TYPO3\CMS\Core\Localization\Locale\$countryCode, TYPO3\CMS\Core\Localization\Locale\$languageCode, TYPO3\CMS\Core\Localization\Locale\$languageScript, TYPO3\CMS\Core\Localization\Locale\$locale, and TYPO3\CMS\Core\Localization\Locale\normalize().

Member Function Documentation

◆ __toString()

TYPO3\CMS\Core\Localization\Locale::__toString ( )

Definition at line 181 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$locale.

◆ getCountryCode()

TYPO3\CMS\Core\Localization\Locale::getCountryCode ( )

Definition at line 128 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$countryCode.

◆ getDependencies()

TYPO3\CMS\Core\Localization\Locale::getDependencies ( )

Definition at line 164 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$dependencies.

◆ getLanguageCode()

TYPO3\CMS\Core\Localization\Locale::getLanguageCode ( )

Definition at line 113 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$languageCode.

◆ getLanguageScriptCode()

TYPO3\CMS\Core\Localization\Locale::getLanguageScriptCode ( )

Definition at line 123 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$languageScript.

◆ getName()

TYPO3\CMS\Core\Localization\Locale::getName ( )

Definition at line 108 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$locale.

◆ getPosixCodeSet()

TYPO3\CMS\Core\Localization\Locale::getPosixCodeSet ( )

Definition at line 159 of file Locale.php.

References TYPO3\CMS\Core\Localization\Locale\$codeSet.

◆ isRightToLeftLanguageDirection()

TYPO3\CMS\Core\Localization\Locale::isRightToLeftLanguageDirection ( )

Definition at line 118 of file Locale.php.

◆ normalize()

TYPO3\CMS\Core\Localization\Locale::normalize ( string  $locale)
protected

◆ posixFormatted()

Member Data Documentation

◆ $charsetModifier

string TYPO3\CMS\Core\Localization\Locale::$charsetModifier = null
protected

◆ $codeSet

string TYPO3\CMS\Core\Localization\Locale::$codeSet = null
protected

◆ $countryCode

string TYPO3\CMS\Core\Localization\Locale::$countryCode = null
protected

◆ $dependencies

array TYPO3\CMS\Core\Localization\Locale::$dependencies = []
protected

Definition at line 64 of file Locale.php.

Referenced by TYPO3\CMS\Core\Localization\Locale\getDependencies().

◆ $languageCode

string TYPO3\CMS\Core\Localization\Locale::$languageCode
protected

◆ $languageScript

string TYPO3\CMS\Core\Localization\Locale::$languageScript = null
protected

◆ $locale

◆ RIGHT_TO_LEFT_LANGUAGE_CODES

const TYPO3\CMS\Core\Localization\Locale::RIGHT_TO_LEFT_LANGUAGE_CODES
protected
Initial value:
= [
'ar',
'arc',
'arz',
'ckb',
'dv',
'fa',
'ha',
'he',
'khw',
'ks',
'ps',
'sd',
'ur',
'uz-AF',
'yi',
]

Definition at line 40 of file Locale.php.