class Translator (View source)

Methods

__construct(string $lang, string $directory, $auto_detected = false)

Translator constructor.

static Translator
configure(string $lang, string $directory)

Configure translator

static Translator
getInstance()

Get singleton instance

static bool
isLocale(string $locale)

Check the locale

static string
translate(string $key, array $data = [], bool $plurial = false)

Permet de faire la tranduction

static string
single($key, array $data = [])

No description

static string
pluiral($key, array $data = [])

No description

static 
setLocale($locale)

Update locale

static string
getLocale()

Get locale

string
__call($name, $arguments)

__call

Details

__construct(string $lang, string $directory, $auto_detected = false)

Translator constructor.

Parameters

string $lang
string $directory
$auto_detected

static Translator configure(string $lang, string $directory)

Configure translator

Parameters

string $lang
string $directory

Return Value

Translator

static Translator getInstance()

Get singleton instance

Return Value

Translator

static bool isLocale(string $locale)

Check the locale

Parameters

string $locale

Return Value

bool

static string translate(string $key, array $data = [], bool $plurial = false)

Permet de faire la tranduction

Parameters

string $key
array $data
bool $plurial

Return Value

string

static string single($key, array $data = [])

No description

Parameters

$key
array $data

Return Value

string

static string pluiral($key, array $data = [])

No description

Parameters

$key
array $data

Return Value

string

static setLocale($locale)

Update locale

Parameters

$locale

static string getLocale()

Get locale

Return Value

string

string __call($name, $arguments)

__call

Parameters

$name
$arguments

Return Value

string