API / Minn\I18n / LocaleStack

LocaleStack final class

Minn\I18n\LocaleStack · public/minn/src/Minn/I18n/LocaleStack.php · 42 lines

The locales a request switched into, innermost last, each with the user whose locale it is (false when a locale was named outright). Empty means the request speaks its own locale.

Constants and properties

privatearray $stack

Public

methodpush(string $locale, int|false $userId = false): void#

Enters a locale, a user's or one named outright.

methodpop(): ?string#

Leaves the innermost locale; the one now in force, or null when none is switched.

methodclear(): void#

Leaves every switched locale.

methodcurrent(): ?string#

The innermost switched locale, or null.

methodcurrentUser(): int|false#

The user whose locale is innermost, or false (none switched, or a locale named outright).

methodswitched(): bool#

Whether any locale is switched in.