PHP Class Tools\Utility\L10n

Forward-port of the 2.x core L10n class to support resolvment of iso2/iso3 letter codes and their language names. TODO: Make locale and localeFallback always iso2-letter-codes (deu => de) as per 3.x convention.
Deprecation: Only for upgrading and matching. Use intl PHP libs directly instead.
Datei anzeigen Open project: dereuromark/cakephp-tools Class Usage Examples

Protected Properties

Property Type Description
$_l10nCatalog array holds all information related to a language
$_l10nMap array They are the ones building the path in /APP/Locale/[code]/ The bibliographic codes are aliases.

Public Methods

Method Description
__construct ( ) Class constructor
catalog ( string | array | null $language = null ) : array | boolean Attempts to find catalog record for requested language
map ( string | array | null $mixed = null ) : string | array | boolean Attempts to find locale for language, or language for locale

Method Details

__construct() public method

Class constructor
public __construct ( )

catalog() public method

Attempts to find catalog record for requested language
public catalog ( string | array | null $language = null ) : array | boolean
$language string | array | null String requested language, array of requested languages, or null for whole catalog
return array | boolean array catalog record for requested language, array of catalog records, whole catalog, or false when language doesn't exist

map() public method

Attempts to find locale for language, or language for locale
public map ( string | array | null $mixed = null ) : string | array | boolean
$mixed string | array | null 2/3 char string (language/locale), array of those strings, or null
return string | array | boolean string language/locale, array of those values, whole map as an array, or false when language/locale doesn't exist

Property Details

$_l10nCatalog protected_oe property

holds all information related to a language
protected array $_l10nCatalog
return array

$_l10nMap protected_oe property

They are the ones building the path in /APP/Locale/[code]/ The bibliographic codes are aliases.
protected array $_l10nMap
return array