PHP 클래스 Neos\Flow\I18n\Cldr\CldrRepository

CldrRepository manages CldrModel instances across the framework, so there is only one instance of CldrModel for every unique CLDR data file or file group.
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cldrBasePath string An absolute path to the directory where CLDR resides. It is changed only in tests.
$localizationService Neos\Flow\I18n\Service
$models array This is an associative array with pairs as follow: ['path']['locale'] => $model, where 'path' is a file or directory path and 'locale' is a Locale object. For models representing one CLDR file, the 'path' points to a file and 'locale' is not used. For models representing few CLDR files connected with hierarchical relation, 'path' points to a directory where files reside and 'locale' is used to define which files are included in the relation (e.g. for locale 'en_GB' files would be: root + en + en_GB).

공개 메소드들

메소드 설명
getModel ( string $filename ) : CldrModel | boolean Returns an instance of CldrModel which represents CLDR file found under specified path.
getModelForLocale ( Locale $locale, string $directoryPath = 'main' ) : CldrModel Returns an instance of CldrModel which represents group of CLDR files which are related in hierarchy.
injectLocalizationService ( Service $localizationService ) : void

보호된 메소드들

메소드 설명
findLocaleChain ( Locale $locale, string $directoryPath ) : array Returns absolute paths to CLDR files connected in hierarchy

메소드 상세

findLocaleChain() 보호된 메소드

For given locale, many CLDR files have to be merged in order to get full set of CLDR data. For example, for 'en_GB' locale, files 'root', 'en', and 'en_GB' should be merged.
protected findLocaleChain ( Locale $locale, string $directoryPath ) : array
$locale Neos\Flow\I18n\Locale A locale
$directoryPath string Relative path to existing CLDR directory which contains one file per locale (see 'main' directory in CLDR for example)
리턴 array

getModel() 공개 메소드

Will return existing instance if a model for given $filename was already requested before. Returns FALSE when $filename doesn't point to existing file.
public getModel ( string $filename ) : CldrModel | boolean
$filename string Relative (from CLDR root) path to existing CLDR file
리턴 CldrModel | boolean A CldrModel instance or FALSE on failure

getModelForLocale() 공개 메소드

This method finds a group of CLDR files within $directoryPath dir, for particular Locale. Returned model represents whole locale-chain. For example, for locale en_GB, returned model could represent 'en_GB', 'en', and 'root' CLDR files. Returns FALSE when $directoryPath doesn't point to existing directory.
public getModelForLocale ( Locale $locale, string $directoryPath = 'main' ) : CldrModel
$locale Neos\Flow\I18n\Locale A locale
$directoryPath string Relative path to existing CLDR directory which contains one file per locale (see 'main' directory in CLDR for example)
리턴 CldrModel A CldrModel instance or NULL on failure

injectLocalizationService() 공개 메소드

public injectLocalizationService ( Service $localizationService ) : void
$localizationService Neos\Flow\I18n\Service
리턴 void

프로퍼티 상세

$cldrBasePath 보호되어 있는 프로퍼티

An absolute path to the directory where CLDR resides. It is changed only in tests.
protected string $cldrBasePath
리턴 string

$localizationService 보호되어 있는 프로퍼티

protected Service,Neos\Flow\I18n $localizationService
리턴 Neos\Flow\I18n\Service

$models 보호되어 있는 프로퍼티

This is an associative array with pairs as follow: ['path']['locale'] => $model, where 'path' is a file or directory path and 'locale' is a Locale object. For models representing one CLDR file, the 'path' points to a file and 'locale' is not used. For models representing few CLDR files connected with hierarchical relation, 'path' points to a directory where files reside and 'locale' is used to define which files are included in the relation (e.g. for locale 'en_GB' files would be: root + en + en_GB).
protected array $models
리턴 array