PHP 클래스 Neos\Flow\I18n\Service

파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache Neos\Cache\Frontend\VariableFrontend
$configuration Configuration
$localeBasePath string The base path to use in filesystem operations. It is changed only in tests.
$localeCollection LocaleCollection A collection of Locale objects representing currently installed locales, in a hierarchical manner.
$packageManager Neos\Flow\Package\PackageManagerInterface
$settings array

공개 메소드들

메소드 설명
findBestMatchingLocale ( Locale $locale ) : mixed Returns Locale object which is the most similar to the "template" Locale object given as parameter, from the collection of locales available in the current Flow installation.
getConfiguration ( ) : Configuration
getLocaleChain ( Locale $locale ) : array Build a chain of locale objects according to the fallback rule and the available locales.
getLocalizedFilename ( string $pathAndFilename, Locale $locale = null, boolean $strict = false ) : array Returns the path to the existing localized version of file given.
getParentLocaleOf ( Locale $locale ) : Locale Returns a parent Locale object of the locale provided.
getXliffFilenameAndPath ( string $path, string $sourceName, Locale $locale = null ) : array Returns the path to the existing localized version of file given.
initializeObject ( ) : void Initializes the locale service
injectSettings ( array $settings ) : void

보호된 메소드들

메소드 설명
generateAvailableLocalesCollectionByScanningFilesystem ( ) : void Finds all Locale objects representing locales available in the Flow installation. This is done by scanning all Private and Public resource files of all active packages, in order to find localized files.
getScanBlacklistPattern ( ) : string Returns a regex pattern including enclosing characters, that matches any of the configured blacklist paths inside "Neos.Flow.i18n.scan.excludePatterns".

메소드 상세

findBestMatchingLocale() 공개 메소드

Returns Locale object which is the most similar to the "template" Locale object given as parameter, from the collection of locales available in the current Flow installation.
public findBestMatchingLocale ( Locale $locale ) : mixed
$locale Locale The "template" Locale to be matched
리턴 mixed Existing Locale instance on success, NULL on failure

generateAvailableLocalesCollectionByScanningFilesystem() 보호된 메소드

Localized files have a locale identifier added before their extension (or at the end of filename, if no extension exists). For example, a localized file for foobar.png, can be foobar.en.png, fobar.en_GB.png, etc. Just one localized resource file causes the corresponding locale to be regarded as available (installed, supported). Note: result of this method invocation is cached

getConfiguration() 공개 메소드

public getConfiguration ( ) : Configuration
리턴 Configuration

getLocaleChain() 공개 메소드

Build a chain of locale objects according to the fallback rule and the available locales.
public getLocaleChain ( Locale $locale ) : array
$locale Locale
리턴 array

getLocalizedFilename() 공개 메소드

Searching is done for the current locale if no $locale parameter is provided. The search is done according to the configured fallback rule. If parameter $strict is provided, searching is done only for the provided / current locale (without searching of files localized for more generic locales). If no localized version of file is found, $filepath is returned without any change.
또한 보기: Configuration::setFallbackRule()
public getLocalizedFilename ( string $pathAndFilename, Locale $locale = null, boolean $strict = false ) : array
$pathAndFilename string Path to the file
$locale Locale Desired locale of localized file
$strict boolean Whether to match only provided locale (TRUE) or search for best-matching locale (FALSE)
리턴 array Path to the localized file (or $filename when no localized file was found) and the matched locale

getParentLocaleOf() 공개 메소드

Returns a parent Locale object of the locale provided.
public getParentLocaleOf ( Locale $locale ) : Locale
$locale Locale The Locale to search parent for
리턴 Locale Existing Locale instance or NULL on failure

getScanBlacklistPattern() 보호된 메소드

Returns a regex pattern including enclosing characters, that matches any of the configured blacklist paths inside "Neos.Flow.i18n.scan.excludePatterns".
protected getScanBlacklistPattern ( ) : string
리턴 string The regex pattern matching the configured blacklist

getXliffFilenameAndPath() 공개 메소드

Searching is done for the current locale if no $locale parameter is provided. The search is done according to the configured fallback rule. If parameter $strict is provided, searching is done only for the provided / current locale (without searching of files localized for more generic locales). If no localized version of file is found, $filepath is returned without any change.
또한 보기: Configuration::setFallbackRule()
public getXliffFilenameAndPath ( string $path, string $sourceName, Locale $locale = null ) : array
$path string Base directory to the translation files
$sourceName string name of the translation source
$locale Locale Desired locale of XLIFF file
리턴 array Path to the localized file (or $filename when no localized file was found) and the matched locale

initializeObject() 공개 메소드

Initializes the locale service
public initializeObject ( ) : void
리턴 void

injectSettings() 공개 메소드

public injectSettings ( array $settings ) : void
$settings array
리턴 void

프로퍼티 상세

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

protected VariableFrontend,Neos\Cache\Frontend $cache
리턴 Neos\Cache\Frontend\VariableFrontend

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

protected Configuration,Neos\Flow\I18n $configuration
리턴 Configuration

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

The base path to use in filesystem operations. It is changed only in tests.
protected string $localeBasePath
리턴 string

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

A collection of Locale objects representing currently installed locales, in a hierarchical manner.
protected LocaleCollection,Neos\Flow\I18n $localeCollection
리턴 LocaleCollection

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

protected PackageManagerInterface,Neos\Flow\Package $packageManager
리턴 Neos\Flow\Package\PackageManagerInterface

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

protected array $settings
리턴 array