PHP Класс RainLab\Translate\Classes\Translator

Автор: Alexey Bobkov, Samuel Georges
Наследование: use trait October\Rain\Support\Traits\Singleton
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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