PHP 클래스 Polyglot\Services\Lang

상속: extends Illuminate\Translation\Translator
파일 보기 프로젝트 열기: anahkiasen/polyglot

보호된 프로퍼티들

프로퍼티 타입 설명
$app Illuminate\Container\Container The IoC Container
$domain string The translation domain
$encoding string The localization encoding

공개 메소드들

메소드 설명
__construct ( Illuminate\Container\Container $app ) Build the language class
active ( string $locale ) : boolean Whether a given language is the current one
defaultLocale ( ) : string Get the default locale
fallbackLocale ( ) : string Get the fallback locale
get ( string $key, array $replace = [], string $locale = null ) : string Get the translation for the given key, or fallback to fallback locale
getAvailable ( ) : array Get all available languages
getDomain ( ) : string Get the translation domain
getEncoding ( boolean $slug = false ) : string Get the encoding
getInternalLocale ( ) : string Get the internal locale
getLocaleFolder ( string $locale ) : string Get the folder where a locale's translations reside
getShortInternalLocale ( ) : string Get the short version of the internal locale
getTranslationsFolder ( string $subfolder = null ) : string Get the folder where the translations reside
sanitize ( string $locale = null ) : string Sanitize a locale
setInternalLocale ( string | boolean $locale = false ) : string Sets the locale according to the current language
setLocale ( string $locale ) : string Change the current language
shortToLongLocale ( string $locale ) : string Translate a short locale to long (en => en_US)
valid ( string $locale ) : boolean Check whether a language is valid or not

메소드 상세

__construct() 공개 메소드

Build the language class
public __construct ( Illuminate\Container\Container $app )
$app Illuminate\Container\Container

active() 공개 메소드

Whether a given language is the current one
public active ( string $locale ) : boolean
$locale string The language to check
리턴 boolean

defaultLocale() 공개 메소드

Get the default locale
public defaultLocale ( ) : string
리턴 string

fallbackLocale() 공개 메소드

Get the fallback locale
public fallbackLocale ( ) : string
리턴 string

get() 공개 메소드

Get the translation for the given key, or fallback to fallback locale
public get ( string $key, array $replace = [], string $locale = null ) : string
$key string
$replace array
$locale string
리턴 string

getAvailable() 공개 메소드

Get all available languages
public getAvailable ( ) : array
리턴 array An array of languages

getDomain() 공개 메소드

Get the translation domain
public getDomain ( ) : string
리턴 string

getEncoding() 공개 메소드

Get the encoding
public getEncoding ( boolean $slug = false ) : string
$slug boolean
리턴 string

getInternalLocale() 공개 메소드

Get the internal locale
public getInternalLocale ( ) : string
리턴 string

getLocaleFolder() 공개 메소드

Get the folder where a locale's translations reside
public getLocaleFolder ( string $locale ) : string
$locale string
리턴 string

getShortInternalLocale() 공개 메소드

Get the short version of the internal locale
public getShortInternalLocale ( ) : string
리턴 string

getTranslationsFolder() 공개 메소드

Get the folder where the translations reside
public getTranslationsFolder ( string $subfolder = null ) : string
$subfolder string
리턴 string

sanitize() 공개 메소드

Sanitize a locale
public sanitize ( string $locale = null ) : string
$locale string
리턴 string

setInternalLocale() 공개 메소드

Sets the locale according to the current language
public setInternalLocale ( string | boolean $locale = false ) : string
$locale string | boolean A language string to use
리턴 string

setLocale() 공개 메소드

Change the current language
public setLocale ( string $locale ) : string
$locale string The language to change to
리턴 string

shortToLongLocale() 공개 메소드

Translate a short locale to long (en => en_US)
public shortToLongLocale ( string $locale ) : string
$locale string
리턴 string

valid() 공개 메소드

Check whether a language is valid or not
public valid ( string $locale ) : boolean
$locale string The language
리턴 boolean

프로퍼티 상세

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

The IoC Container
protected Container,Illuminate\Container $app
리턴 Illuminate\Container\Container

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

The translation domain
protected string $domain
리턴 string

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

The localization encoding
protected string $encoding
리턴 string