class language_file_loader

Language file loader

Properties

protected string $phpbb_root_path
protected string $php_ext
protected manager|null $extension_manager

Methods

__construct(string $phpbb_root_path, string $php_ext)

Constructor

set_extension_manager(manager $extension_manager)

Extension manager setter

load(string $component, string|array $locale, array $lang)

Loads language array for the given component

load_extension(string $extension, string $component, string|array $locale, array $lang)

Loads language array for the given extension component

load_file(string $path, string $component, array $locale, array $lang)

Prepares language file loading

string
get_language_file_path(string $path, string $filename, array $locales)

This function implements language fallback logic

load_language_file(string $path, array $lang)

Loads language file

Details

at line 44
__construct(string $phpbb_root_path, string $php_ext)

Constructor

Parameters

string $phpbb_root_path

Path to phpBB's root

string $php_ext

Extension of PHP files

at line 57
set_extension_manager(manager $extension_manager)

Extension manager setter

Parameters

manager $extension_manager

Extension manager

at line 70
load(string $component, string|array $locale, array $lang)

Loads language array for the given component

Parameters

string $component

Name of the language component

string|array $locale

ISO code of the language to load, or array of ISO codes if you want to specify additional language fallback steps

array $lang

Array reference containing language strings

at line 89
load_extension(string $extension, string $component, string|array $locale, array $lang)

Loads language array for the given extension component

Parameters

string $extension

Name of the extension

string $component

Name of the language component

string|array $locale

ISO code of the language to load, or array of ISO codes if you want to specify additional language fallback steps

array $lang

Array reference containing language strings

at line 114
protected load_file(string $path, string $component, array $locale, array $lang)

Prepares language file loading

Parameters

string $path

Path to search for file in

string $component

Name of the language component

array $locale

Array containing language fallback options

array $lang

Array reference of language strings

at line 160
protected string get_language_file_path(string $path, string $filename, array $locales)

This function implements language fallback logic

Parameters

string $path

Path to language directory

string $filename

Filename to load language strings from

array $locales

Array containing language fallback options

Return Value

string

Relative path to language file

Exceptions

language_file_not_found

When the path to the file cannot be resolved

at line 195
protected load_language_file(string $path, array $lang)

Loads language file

Parameters

string $path

Path to language file to load

array $lang

Reference of the array of language strings