PHP Class Lang, someline-starter

Afficher le fichier Open project: someline/someline-starter Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

addNamespace() public static méthode

Add a new namespace to the loader.
public static addNamespace ( string $namespace, string $hint ) : void
$namespace string
$hint string
Résultat void

choice() public static méthode

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
Résultat string

get() public static méthode

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
Résultat string | array | null

getFallback() public static méthode

Get the fallback locale being used.
public static getFallback ( ) : string
Résultat string

getLoader() public static méthode

Get the language line loader implementation.
public static getLoader ( ) : Illuminate\Translation\LoaderInterface
Résultat Illuminate\Translation\LoaderInterface

getLocale() public static méthode

Get the default locale being used.
public static getLocale ( ) : string
Résultat string

getSelector() public static méthode

Get the message selector instance.
public static getSelector ( ) : Symfony\Component\Translation\MessageSelector
Résultat Symfony\Component\Translation\MessageSelector

has() public static méthode

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
Résultat boolean

hasForLocale() public static méthode

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

load() public static méthode

Load the specified language group.
public static load ( string $namespace, string $group, string $locale ) : void
$namespace string
$group string
$locale string
Résultat void

locale() public static méthode

Get the default locale being used.
public static locale ( ) : string
Résultat string

parseKey() public static méthode

Parse a key into namespace, group, and item.
public static parseKey ( string $key ) : array
$key string
Résultat array

setFallback() public static méthode

Set the fallback locale being used.
public static setFallback ( string $fallback ) : void
$fallback string
Résultat void

setLocale() public static méthode

Set the default locale.
public static setLocale ( string $locale ) : void
$locale string
Résultat void

setParsedKey() public static méthode

Set the parsed value of a key.
public static setParsedKey ( string $key, array $parsed ) : void
$key string
$parsed array
Résultat void

setSelector() public static méthode

Set the message selector instance.
public static setSelector ( Symfony\Component\Translation\MessageSelector $selector ) : void
$selector Symfony\Component\Translation\MessageSelector
Résultat void

trans() public static méthode

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
Résultat string | array | null

transChoice() public static méthode

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
Résultat string