Elgg
Version 2.3
|
Go to the source code of this file.
Namespaces | |
Elgg\Core | |
Activate a plugin or plugins. | |
Functions | |
elgg_echo ($message_key, $args=array(), $language="") | |
Given a message key, returns an appropriately translated full-text string. More... | |
add_translation ($country_code, $language_array) | |
Add a translation. More... | |
get_current_language () | |
Get the current system/user language or "en". More... | |
get_language () | |
Detect the current system/user language or false. More... | |
register_translations ($path, $load_all=false, $language=null) | |
When given a full path, finds translation files and loads them. More... | |
reload_all_translations () | |
Reload all translations from all registered paths. More... | |
get_installed_translations () | |
Return an array of installed translations as an associative array "two letter code" => "native language name". More... | |
get_language_completeness ($language) | |
Return the level of completeness for a given language code (compared to english) More... | |
get_missing_language_keys ($language) | |
Return the translation keys missing from a given language, or those that are identical to the english version. More... | |
elgg_language_key_exists ($key, $language= 'en') | |
Check if a given language key exists. More... | |
Variables | |
return | function (\Elgg\EventsService $events) |
add_translation | ( | $country_code, | |
$language_array | |||
) |
Add a translation.
Translations are arrays in the Zend Translation array format, eg:
$english = array('message1' => 'message1', 'message2' => 'message2'); $german = array('message1' => 'Nachricht1','message2' => 'Nachricht2');
string | $country_code | Standard country code (eg 'en', 'nl', 'es') |
array | $language_array | Formatted array of strings |
Definition at line 38 of file languages.php.
elgg_echo | ( | $message_key, | |
$args = array() , |
|||
$language = "" |
|||
) |
Given a message key, returns an appropriately translated full-text string.
string | $message_key | The short message code |
array | $args | An array of arguments to pass through vsprintf(). |
string | $language | Optionally, the standard language code (defaults to site/user default, then English) |
Definition at line 21 of file languages.php.
elgg_language_key_exists | ( | $key, | |
$language = 'en' |
|||
) |
Check if a given language key exists.
string | $key | The translation key |
string | $language | The language. Provided an English translation exists for all created keys, then devs can generally use the default "en", regardless of the site/user language. |
Definition at line 133 of file languages.php.
get_current_language | ( | ) |
Get the current system/user language or "en".
Definition at line 47 of file languages.php.
get_installed_translations | ( | ) |
Return an array of installed translations as an associative array "two letter code" => "native language name".
Definition at line 93 of file languages.php.
get_language | ( | ) |
Detect the current system/user language or false.
Definition at line 56 of file languages.php.
get_language_completeness | ( | $language | ) |
Return the level of completeness for a given language code (compared to english)
string | $language | Language |
Definition at line 104 of file languages.php.
get_missing_language_keys | ( | $language | ) |
Return the translation keys missing from a given language, or those that are identical to the english version.
string | $language | The language |
Definition at line 116 of file languages.php.
register_translations | ( | $path, | |
$load_all = false , |
|||
$language = null |
|||
) |
When given a full path, finds translation files and loads them.
string | $path | Full path |
bool | $load_all | If true all languages are loaded, if false only the current language + en are loaded |
string | $language | Language code if other than current + en |
Definition at line 70 of file languages.php.
reload_all_translations | ( | ) |
Reload all translations from all registered paths.
This is only called by functions which need to know all possible translations.
Definition at line 83 of file languages.php.
return function(\Elgg\EventsService $events) |
Definition at line 137 of file languages.php.