interface Translator (View source)

Methods

mixed
get(string $key, array $replace = [], string|null $locale = null)

Get the translation for a given key.

string
choice(string $key, Countable|int|array $number, array $replace = [], string|null $locale = null)

Get a translation according to an integer value.

string
getLocale()

Get the default locale being used.

void
setLocale(string $locale)

Set the default locale.

Details

mixed get(string $key, array $replace = [], string|null $locale = null)

Get the translation for a given key.

Parameters

string $key
array $replace
string|null $locale

Return Value

mixed

string choice(string $key, Countable|int|array $number, array $replace = [], string|null $locale = null)

Get a translation according to an integer value.

Parameters

string $key
Countable|int|array $number
array $replace
string|null $locale

Return Value

string

string getLocale()

Get the default locale being used.

Return Value

string

void setLocale(string $locale)

Set the default locale.

Parameters

string $locale

Return Value

void

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.