PHP 클래스 Xinax\LaravelGettext\LaravelGettext

파일 보기 프로젝트 열기: xinax/laravel-gettext 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$translator Xinax\LaravelGettext\Translators\TranslatorInterface Translator handler

공개 메소드들

메소드 설명
__construct ( Xinax\LaravelGettext\Translators\TranslatorInterface $gettext )
getDomain ( ) : string Returns the current domain
getEncoding ( ) : string Get the current encoding
getLocale ( ) : string Gets the Current locale.
getLocaleLanguage ( string | null $locale = null ) : string | null Get the language portion of the locale (ex. en_GB returns en)
getSelector ( array $labels = [] ) : LanguageSelector Get the language selector object
getSupportedLocales ( ) : array Returns supported locales
getTranslator ( ) : Xinax\LaravelGettext\Translators\TranslatorInterface Returns the translator.
isLocaleSupported ( $locale ) : boolean Indicates if given locale is supported
setDomain ( string $domain ) Sets the current domain
setEncoding ( string $encoding ) Set the current encoding
setLocale ( string $locale ) Set current locale
setTranslator ( Xinax\LaravelGettext\Translators\TranslatorInterface $translator ) Sets the translator
translate ( $message ) : string Translates a message with the current handler
translatePlural ( $singular, $plural, $count ) : string Translates a plural string with the current handler

메소드 상세

__construct() 공개 메소드

public __construct ( Xinax\LaravelGettext\Translators\TranslatorInterface $gettext )
$gettext Xinax\LaravelGettext\Translators\TranslatorInterface

getDomain() 공개 메소드

Returns the current domain
public getDomain ( ) : string
리턴 string

getEncoding() 공개 메소드

Get the current encoding
public getEncoding ( ) : string
리턴 string

getLocale() 공개 메소드

Gets the Current locale.
public getLocale ( ) : string
리턴 string

getLocaleLanguage() 공개 메소드

Get the language portion of the locale (ex. en_GB returns en)
public getLocaleLanguage ( string | null $locale = null ) : string | null
$locale string | null
리턴 string | null

getSelector() 공개 메소드

Get the language selector object
public getSelector ( array $labels = [] ) : LanguageSelector
$labels array
리턴 Xinax\LaravelGettext\Composers\LanguageSelector

getSupportedLocales() 공개 메소드

Returns supported locales
public getSupportedLocales ( ) : array
리턴 array

getTranslator() 공개 메소드

Returns the translator.
public getTranslator ( ) : Xinax\LaravelGettext\Translators\TranslatorInterface
리턴 Xinax\LaravelGettext\Translators\TranslatorInterface

isLocaleSupported() 공개 메소드

Indicates if given locale is supported
public isLocaleSupported ( $locale ) : boolean
리턴 boolean

setDomain() 공개 메소드

Sets the current domain
public setDomain ( string $domain )
$domain string

setEncoding() 공개 메소드

Set the current encoding
public setEncoding ( string $encoding )
$encoding string

setLocale() 공개 메소드

Set current locale
public setLocale ( string $locale )
$locale string

setTranslator() 공개 메소드

Sets the translator
public setTranslator ( Xinax\LaravelGettext\Translators\TranslatorInterface $translator )
$translator Xinax\LaravelGettext\Translators\TranslatorInterface

translate() 공개 메소드

Translates a message with the current handler
public translate ( $message ) : string
$message
리턴 string

translatePlural() 공개 메소드

Translates a plural string with the current handler
public translatePlural ( $singular, $plural, $count ) : string
$singular
$plural
$count
리턴 string

프로퍼티 상세

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

Translator handler
protected TranslatorInterface,Xinax\LaravelGettext\Translators $translator
리턴 Xinax\LaravelGettext\Translators\TranslatorInterface