API / Minn\Runtime / Translations

Translations final class

Minn\Runtime\Translations · public/minn/src/Minn/Runtime/Translations.php · 126 lines

The translations a request loads, as WordPress's l10n functions load them: the locale in force, a text domain loaded from its file (or its folder named for later) and unloaded, the default domain, a plugin's, a user's locale, and the translations installed on disk; each step with the filters that may answer first.

Public

staticlocale(): string#

The locale in force (determine_locale): a switched one, else pre_determine_locale, else the site's through determine_locale.

staticload(mixed $domain, mixed $mofile, mixed $locale = NULL): bool#

A text domain loaded from a translation file (load_textdomain), the PHP file beside the .mo first unless translation_file_format says mo; whether one loaded. Its locale becomes the one translations are looked up in, and its folder where its script translations are looked for.

staticunload(mixed $domain, mixed $reloadable = false): bool#

A text domain unloaded (unload_textdomain): whether it had files; one that did stays closed unless it may load again.

staticfromFolder(string $domain, string $folder, string $file, string $locale): bool#

A domain loaded from a folder's file for the locale when there is one, or the folder named for later; a domain closed for good loads nothing.

staticloadDefault(mixed $locale = NULL): bool#

The default domain loaded again for a locale, the one in force unless named (load_default_textdomain).

staticloadPlugin(mixed $domain, mixed $deprecated = false, mixed $relativePath = false): bool#

A plugin's domain loaded from its folder (load_plugin_textdomain), the plugins folder unless a path under it is given.

staticuserLocale(mixed $user = 0): string#

A user's locale (get_user_locale), the signed-in user's for 0; the site's when the user has none or does not exist.

staticinstalled(mixed $type): array#

The translations installed (wp_get_installed_translations) for core, plugins or themes: by text domain and locale, each with its file's headers; a .po without its .mo is not one.

@return array<string, array<string, array<string, string>>>