PHP Интерфейс Stevebauman\Translation\Contracts\Translation

Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Illuminate\Contracts\Foundation\Application $app ) Constructor.
getAppLocale ( ) : string Retrieves the current app's default locale.
getDefaultTranslation ( string $text ) : Model Returns the translation by the specified text and the applications default locale.
getLocale ( ) : string Retrieves the current locale from the session. If a locale isn't set then the default app locale is set as the current locale.
getRoutePrefix ( ) : null | string Returns a route prefix to automatically set a locale depending on the segment.
setLocale ( string $code = '' ) Sets the default locale property.
translate ( string $text = '', array $replacements = [], string $toLocale = '' ) : string Returns the translation for the current locale.

Описание методов

__construct() публичный метод

Constructor.
public __construct ( Illuminate\Contracts\Foundation\Application $app )
$app Illuminate\Contracts\Foundation\Application

getAppLocale() публичный метод

Retrieves the current app's default locale.
public getAppLocale ( ) : string
Результат string

getDefaultTranslation() публичный метод

Returns the translation by the specified text and the applications default locale.
public getDefaultTranslation ( string $text ) : Model
$text string
Результат Illuminate\Database\Eloquent\Model

getLocale() публичный метод

Retrieves the current locale from the session. If a locale isn't set then the default app locale is set as the current locale.
public getLocale ( ) : string
Результат string

getRoutePrefix() публичный метод

Returns a route prefix to automatically set a locale depending on the segment.
public getRoutePrefix ( ) : null | string
Результат null | string

setLocale() публичный метод

Sets the default locale property.
public setLocale ( string $code = '' )
$code string

translate() публичный метод

Returns the translation for the current locale.
public translate ( string $text = '', array $replacements = [], string $toLocale = '' ) : string
$text string
$replacements array
$toLocale string
Результат string