PHP 클래스 Lang, someline-starter

파일 보기 프로젝트 열기: someline/someline-starter 1 사용 예제들

공개 메소드들

메소드 설명
addNamespace ( string $namespace, string $hint ) : void Add a new namespace to the loader.
choice ( string $key, integer | array | Countable $number, array $replace = [], string $locale = null ) : string Get a translation according to an integer value.
get ( string $key, array $replace = [], string | null $locale = null, boolean $fallback = true ) : string | array | null Get the translation for the given key.
getFallback ( ) : string Get the fallback locale being used.
getLoader ( ) : Illuminate\Translation\LoaderInterface Get the language line loader implementation.
getLocale ( ) : string Get the default locale being used.
getSelector ( ) : Symfony\Component\Translation\MessageSelector Get the message selector instance.
has ( string $key, string | null $locale = null, boolean $fallback = true ) : boolean Determine if a translation exists.
hasForLocale ( string $key, string | null $locale = null ) : boolean Determine if a translation exists for a given locale.
load ( string $namespace, string $group, string $locale ) : void Load the specified language group.
locale ( ) : string Get the default locale being used.
parseKey ( string $key ) : array Parse a key into namespace, group, and item.
setFallback ( string $fallback ) : void Set the fallback locale being used.
setLocale ( string $locale ) : void Set the default locale.
setParsedKey ( string $key, array $parsed ) : void Set the parsed value of a key.
setSelector ( Symfony\Component\Translation\MessageSelector $selector ) : void Set the message selector instance.
trans ( string $id, array $parameters = [], string $domain = 'messages', string $locale = null ) : string | array | null Get the translation for a given key.
transChoice ( string $id, integer | array | Countable $number, array $parameters = [], string $domain = 'messages', string $locale = null ) : string Get a translation according to an integer value.

메소드 상세

addNamespace() 공개 정적인 메소드

Add a new namespace to the loader.
public static addNamespace ( string $namespace, string $hint ) : void
$namespace string
$hint string
리턴 void

choice() 공개 정적인 메소드

Get a translation according to an integer value.
public static choice ( string $key, integer | array | Countable $number, array $replace = [], string $locale = null ) : string
$key string
$number integer | array | Countable
$replace array
$locale string
리턴 string

get() 공개 정적인 메소드

Get the translation for the given key.
public static get ( string $key, array $replace = [], string | null $locale = null, boolean $fallback = true ) : string | array | null
$key string
$replace array
$locale string | null
$fallback boolean
리턴 string | array | null

getFallback() 공개 정적인 메소드

Get the fallback locale being used.
public static getFallback ( ) : string
리턴 string

getLoader() 공개 정적인 메소드

Get the language line loader implementation.
public static getLoader ( ) : Illuminate\Translation\LoaderInterface
리턴 Illuminate\Translation\LoaderInterface

getLocale() 공개 정적인 메소드

Get the default locale being used.
public static getLocale ( ) : string
리턴 string

getSelector() 공개 정적인 메소드

Get the message selector instance.
public static getSelector ( ) : Symfony\Component\Translation\MessageSelector
리턴 Symfony\Component\Translation\MessageSelector

has() 공개 정적인 메소드

Determine if a translation exists.
public static has ( string $key, string | null $locale = null, boolean $fallback = true ) : boolean
$key string
$locale string | null
$fallback boolean
리턴 boolean

hasForLocale() 공개 정적인 메소드

Determine if a translation exists for a given locale.
public static hasForLocale ( string $key, string | null $locale = null ) : boolean
$key string
$locale string | null
리턴 boolean

load() 공개 정적인 메소드

Load the specified language group.
public static load ( string $namespace, string $group, string $locale ) : void
$namespace string
$group string
$locale string
리턴 void

locale() 공개 정적인 메소드

Get the default locale being used.
public static locale ( ) : string
리턴 string

parseKey() 공개 정적인 메소드

Parse a key into namespace, group, and item.
public static parseKey ( string $key ) : array
$key string
리턴 array

setFallback() 공개 정적인 메소드

Set the fallback locale being used.
public static setFallback ( string $fallback ) : void
$fallback string
리턴 void

setLocale() 공개 정적인 메소드

Set the default locale.
public static setLocale ( string $locale ) : void
$locale string
리턴 void

setParsedKey() 공개 정적인 메소드

Set the parsed value of a key.
public static setParsedKey ( string $key, array $parsed ) : void
$key string
$parsed array
리턴 void

setSelector() 공개 정적인 메소드

Set the message selector instance.
public static setSelector ( Symfony\Component\Translation\MessageSelector $selector ) : void
$selector Symfony\Component\Translation\MessageSelector
리턴 void

trans() 공개 정적인 메소드

Get the translation for a given key.
public static trans ( string $id, array $parameters = [], string $domain = 'messages', string $locale = null ) : string | array | null
$id string
$parameters array
$domain string
$locale string
리턴 string | array | null

transChoice() 공개 정적인 메소드

Get a translation according to an integer value.
public static transChoice ( string $id, integer | array | Countable $number, array $parameters = [], string $domain = 'messages', string $locale = null ) : string
$id string
$number integer | array | Countable
$parameters array
$domain string
$locale string
리턴 string