translator_interface
Interface for translation services.
Decouples the framework from Moodle's get_string() global.
Table of Contents
Methods
Methods
has()
Check if a translation exists.
public
has(string $identifier[, null|string $component = null ]) : bool
Parameters
- $identifier : string
- $component : null|string = null
Return values
booltrans()
Translate a string identifier.
public
trans(string $identifier[, null|string $component = null ][, mixed $args = null ]) : string
Parameters
- $identifier : string
-
The string key
- $component : null|string = null
-
The component (plugin) name
- $args : mixed = null
-
Arguments to inject into the string
Return values
string —The translated string