PHP 인터페이스 Stevebauman\Translation\Contracts\Translation

파일 보기 프로젝트 열기: stevebauman/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