Function: text()

function text(string $text_id, string $lng = "", string $default_text = ""): string;

Short function that provides the text translation for the text ID for the given language.

Parameters

Name Pass type Value type Default value Description
$text_id by value string

Text ID

$lng by value string ""

The language. If it is not specified, the default language is used.

$default_text by value string ""

The default text to be used if there is no translation.

Returns

string

Returns the translation text or the $text_id if no translation is found.

Throws

\Exception

It might throw the following exceptions in the case of any errors:

  • if the interface or class is not specified.
  • if the interface or class does not exist.
  • if the check of the classes and interfaces fails.

Authors

Oleg Schildt

Package

Source code