class moodle_translator_adapter implements translator_interface

Adapter that provides translations using Moodle's native string system.

Methods

string
trans(string $identifier, string|null $component = null, mixed $args = null)

Translate a string identifier.

bool
has(string $identifier, string|null $component = null)

Check if a translation exists.

Details

at line 35
string trans(string $identifier, string|null $component = null, mixed $args = null)

Translate a string identifier.

Parameters

string $identifier

The string key

string|null $component

The component (plugin) name

mixed $args

Arguments to inject into the string

Return Value

string

The translated string

at line 49
bool has(string $identifier, string|null $component = null)

Check if a translation exists.

Parameters

string $identifier
string|null $component

Return Value

bool