MIDDAG for Moodle

moodle_translator_adapter implements translator_interface

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

Table of Contents

Interfaces

translator_interface
Interface for translation services.

Properties

$defaultComponent  : string

Methods

has()  : bool
Check if a translation exists.
trans()  : string
Translate a string identifier.

Properties

$defaultComponent

private string $defaultComponent = \local_middag\framework\support\middag_helper::COMPONENT_NAME

Default Moodle component

Methods

has()

Check if a translation exists.

public has(string $identifier[, string|null $component = null ]) : bool
Parameters
$identifier : string
$component : string|null = null
Return values
bool

trans()

Translate a string identifier.

public trans(string $identifier[, string|null $component = null ][, mixed $args = null ]) : string
Parameters
$identifier : string

The string key

$component : string|null = null

The component (plugin) name

$args : mixed = null

Arguments to inject into the string

Return values
string

The translated string


        
On this page

Search results