classe Translator (Voir la source)

Méthodes

__construct(string $lang, string $directory, bool $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)

Allows translation

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

Make singleton translation

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

Make plurial translation

static void
setLocale(string $locale)

Update locale

static string
getLocale()

Get locale

string
__call(string $name, array $arguments)

__call

Détails

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

Translator constructor.

Paramètres

string $lang
string $directory
bool $auto_detected

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

Configure translator

Paramètres

string $lang
string $directory

Valeur de retour

Translator

static Translator getInstance()

Get singleton instance

Valeur de retour

Translator

static bool isLocale(string $locale)

Check the locale

Paramètres

string $locale

Valeur de retour

bool

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

Allows translation

Paramètres

string $key
array $data
bool $plurial

Valeur de retour

string

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

Make singleton translation

Paramètres

string $key
array $data

Valeur de retour

string

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

Make plurial translation

Paramètres

string $key
array $data

Valeur de retour

string

static void setLocale(string $locale)

Update locale

Paramètres

string $locale

Valeur de retour

void

static string getLocale()

Get locale

Valeur de retour

string

string __call(string $name, array $arguments)

__call

Paramètres

string $name
array $arguments

Valeur de retour

string