Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
languages.php
Go to the documentation of this file.
1 <?php
21 function elgg_echo($message_key, $args = array(), $language = "") {
22  return _elgg_services()->translator->translate($message_key, $args, $language);
23 }
24 
38 function add_translation($country_code, $language_array) {
39  return _elgg_services()->translator->addTranslation($country_code, $language_array);
40 }
41 
48  return _elgg_services()->translator->getCurrentLanguage();
49 }
50 
56 function get_language() {
57  return _elgg_services()->translator->detectLanguage();
58 }
59 
70 function register_translations($path, $load_all = false, $language = null) {
71  return _elgg_services()->translator->registerTranslations($path, $load_all, $language);
72 }
73 
84  return _elgg_services()->translator->reloadAllTranslations();
85 }
86 
94  return _elgg_services()->translator->getInstalledTranslations();
95 }
96 
105  return _elgg_services()->translator->getLanguageCompleteness($language);
106 }
107 
117  return _elgg_services()->translator->getMissingLanguageKeys($language);
118 }
119 
134  return _elgg_services()->translator->languageKeyExists($key, $language);
135 }
136 
137 return function(\Elgg\EventsService $events) {};
elgg_language_key_exists($key, $language= 'en')
Check if a given language key exists.
Definition: languages.php:133
reload_all_translations()
Reload all translations from all registered paths.
Definition: languages.php:83
register_translations($path, $load_all=false, $language=null)
When given a full path, finds translation files and loads them.
Definition: languages.php:70
add_translation($country_code, $language_array)
Add a translation.
Definition: languages.php:38
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
get_current_language()
Get the current system/user language or "en".
Definition: languages.php:47
$path
Definition: details.php:88
get_language()
Detect the current system/user language or false.
Definition: languages.php:56
$args
Some servers don't allow PHP to check the rewrite, so try via AJAX.
$key
Definition: summary.php:34
$language
Definition: useradd.php:20
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
Definition: autoloader.php:17
get_installed_translations()
Return an array of installed translations as an associative array "two letter code" => "native langua...
Definition: languages.php:93
get_language_completeness($language)
Return the level of completeness for a given language code (compared to english)
Definition: languages.php:104
get_missing_language_keys($language)
Return the translation keys missing from a given language, or those that are identical to the english...
Definition: languages.php:116