TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
Locales Class Reference
Inheritance diagram for Locales:
SingletonInterface

Public Member Functions

 getLocales ()
 
 getLanguages ()
 
 getIsoMapping ()
 
 getLocaleDependencies ($locale)
 
 getPreferredClientLanguage ($languageCodesList)
 

Protected Attributes

 $languages
 
 $isoReverseMapping
 
 $isoMapping
 
 $localeDependencies
 

Detailed Description

Locales.

Used to define backend system languages When adding new keys, remember to:

  • Update 'setup' extension labels (sysext/setup/Resources/Private/Language/locallang.xlf) That's it!

Definition at line 28 of file Locales.php.

Member Function Documentation

getIsoMapping ( )

Returns the mapping between TYPO3 (old) language codes and ISO codes.

Returns
array

Definition at line 187 of file Locales.php.

References Locales\$isoMapping.

Referenced by Locales\getPreferredClientLanguage().

getLanguages ( )

Returns the supported languages indexed by their corresponding locale.

Returns
array

Definition at line 177 of file Locales.php.

References Locales\$languages.

getLocaleDependencies (   $locale)

Returns the dependencies of a given locale, if any.

Parameters
string$locale
Returns
array

Definition at line 198 of file Locales.php.

References Locales\$localeDependencies.

getLocales ( )

Returns the locales.

Returns
array

Definition at line 167 of file Locales.php.

Referenced by Locales\getPreferredClientLanguage().

getPreferredClientLanguage (   $languageCodesList)

Converts the language codes that we get from the client (usually HTTP_ACCEPT_LANGUAGE) into a TYPO3-readable language code

Parameters
string$languageCodesListList of language codes. something like 'de,en-us;q=0.9,de-de;q=0.7,es-cl;q=0.6,en;q=0.4,es;q=0.3,zh;q=0.1'
Returns
string A preferred language that TYPO3 supports, or "default" if none found

Definition at line 221 of file Locales.php.

References Locales\getIsoMapping(), Locales\getLocales(), and GeneralUtility\trimExplode().

Member Data Documentation

$isoMapping
protected

Definition at line 122 of file Locales.php.

Referenced by Locales\getIsoMapping().

$isoReverseMapping
protected
Initial value:
= [
'bs' => 'ba'

Definition at line 95 of file Locales.php.

$languages
protected
Initial value:
= [
'default' => 'English'

Definition at line 35 of file Locales.php.

Referenced by Locales\getLanguages().

$localeDependencies
protected

Definition at line 129 of file Locales.php.

Referenced by Locales\getLocaleDependencies().