Elgg  Version 5.1
Functions
languages.php File Reference

Go to the source code of this file.

Functions

 elgg_echo (string $message_key, array $args=[], string $language= '')
 Elgg language module Functions to manage language and translations. More...
 
 elgg_get_current_language ()
 Get the current system/user language or 'en'. More...
 
 elgg_language_key_exists (string $key, string $language= 'en')
 Check if a given language key exists. More...
 

Function Documentation

elgg_echo ( string  $message_key,
array  $args = [],
string  $language = '' 
)

Elgg language module Functions to manage language and translations.

Given a message key, returns an appropriately translated full-text string

Parameters
string$message_keyThe short message code
array$argsAn array of arguments to pass through vsprintf().
string$languageOptionally, the standard language code (defaults to site/user default, then English)
Returns
string Either the translated string, the English string or the original language string.
Examples:
/root/Elgg/engine/lib/output.php.

Definition at line 17 of file languages.php.

elgg_get_current_language ( )

Get the current system/user language or 'en'.

Returns
string
Since
4.3
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 27 of file languages.php.

elgg_language_key_exists ( string  $key,
string  $language = 'en' 
)

Check if a given language key exists.

Note
Translators should, whenever creating a "dynamically" named language key, always create an English (fallback) translation as well.
Parameters
string$keyThe translation key
string$languageThe language. Provided an English translation exists for all created keys, then devs can generally use the default "en", regardless of the site/user language.
Returns
bool
Since
1.11

Definition at line 44 of file languages.php.