Elgg
Version 1.9
|
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 () | |
Detect the current language being used by the current site or logged in user. More... | |
get_language () | |
Gets the current language in use by the system or user. More... | |
_elgg_load_translations () | |
private More... | |
_elgg_load_translations_for_language ($language) | |
Load both core and plugin translations for a specific language. More... | |
register_translations ($path, $load_all=false) | |
When given a full path, finds translation files and loads them. More... | |
_elgg_register_translations_for_language ($path, $language) | |
When given a full path, finds translation files for a language 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_load_translations | ( | ) |
private
Definition at line 148 of file languages.php.
_elgg_load_translations_for_language | ( | $language | ) |
Load both core and plugin translations for a specific language.
This can be used to load translations on-demand in case we need to translate something to a language not loaded by default for the current user.
$language | Language code |
PluginException | private |
Definition at line 189 of file languages.php.
_elgg_register_translations_for_language | ( | $path, | |
$language | |||
) |
When given a full path, finds translation files for a language and loads them.
This function was added in 1.9.4 to make it possible to load translations for individual languages on-demand. This is needed in order to send notifications in the recipient's language (see #3151 and #7241).
private
string | $path | Full path of the directory (with trailing slash) |
string | $language | Language code |
Definition at line 323 of file languages.php.
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 85 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.
get_current_language | ( | ) |
Detect the current language being used by the current site or logged in user.
Definition at line 109 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 404 of file languages.php.
get_language | ( | ) |
Gets the current language in use by the system or user.
Definition at line 124 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 432 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 463 of file languages.php.
register_translations | ( | $path, | |
$load_all = false |
|||
) |
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 |
Definition at line 255 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 365 of file languages.php.