PHP Класс Lang, someline-starter

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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