PHP 클래스 RainLab\Translate\Classes\Translator

저자: Alexey Bobkov, Samuel Georges
상속: use trait October\Rain\Support\Traits\Singleton
파일 보기 프로젝트 열기: rainlab/translate-plugin 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$activeLocale The locale to use on the front end.
$defaultLocale The default locale if no active is set.
$isConfigured Determine if translate plugin is configured and ready to be used.

공개 메소드들

메소드 설명
getCurrentPathInLocale ( string $locale = null ) : string Returns the current path prefixed with language code.
getDefaultLocale ( ) : string Returns the default locale as set by the application.
getLocale ( boolean $fromSession = false ) : string Returns the active locale set by this instance.
getPathInLocale ( string $path, string $locale = null ) : string Returns the path prefixed with language code.
init ( ) : void Initialize the singleton
isConfigured ( ) : boolean Check if this plugin is installed and the database is available, stores the result in the session for efficiency.
loadLocaleFromRequest ( ) : boolean Sets the locale based on the first URI segment.
loadLocaleFromSession ( ) : boolean Looks at the session storage to find a locale.
setLocale ( string $locale, boolean $remember = true ) : boolean Changes the locale in the application and optionally stores it in the session.

보호된 메소드들

메소드 설명
getSessionLocale ( )
setSessionLocale ( $locale )

메소드 상세

getCurrentPathInLocale() 공개 메소드

Returns the current path prefixed with language code.
public getCurrentPathInLocale ( string $locale = null ) : string
$locale string optional language code, default to the system default language
리턴 string

getDefaultLocale() 공개 메소드

Returns the default locale as set by the application.
public getDefaultLocale ( ) : string
리턴 string

getLocale() 공개 메소드

Returns the active locale set by this instance.
public getLocale ( boolean $fromSession = false ) : string
$fromSession boolean Look in the session.
리턴 string

getPathInLocale() 공개 메소드

Returns the path prefixed with language code.
public getPathInLocale ( string $path, string $locale = null ) : string
$path string Path to rewrite
$locale string optional language code, default to the system default language
리턴 string

getSessionLocale() 보호된 메소드

protected getSessionLocale ( )

init() 공개 메소드

Initialize the singleton
public init ( ) : void
리턴 void

isConfigured() 공개 메소드

Check if this plugin is installed and the database is available, stores the result in the session for efficiency.
public isConfigured ( ) : boolean
리턴 boolean

loadLocaleFromRequest() 공개 메소드

Sets the locale based on the first URI segment.
public loadLocaleFromRequest ( ) : boolean
리턴 boolean

loadLocaleFromSession() 공개 메소드

Looks at the session storage to find a locale.
public loadLocaleFromSession ( ) : boolean
리턴 boolean

setLocale() 공개 메소드

Changes the locale in the application and optionally stores it in the session.
public setLocale ( string $locale, boolean $remember = true ) : boolean
$locale string Locale to use
$remember boolean Set to false to not store in the session.
리턴 boolean Returns true if the locale exists and is set.

setSessionLocale() 보호된 메소드

protected setSessionLocale ( $locale )

프로퍼티 상세

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

The locale to use on the front end.
protected $activeLocale

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

The default locale if no active is set.
protected $defaultLocale

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

Determine if translate plugin is configured and ready to be used.
protected $isConfigured