39 return _elgg_services()->translator->addTranslation($country_code, $language_array);
78 if (!empty($CONFIG->system_cache_enabled)) {
102 $languages_path =
"{$plugin->getPath()}languages/";
104 if (!is_dir($languages_path)) {
109 $language_file =
"{$languages_path}{$language}.php";
111 if (!file_exists($language_file)) {
114 $name = $plugin->getFriendlyName();
115 elgg_log(
"Plugin $name is missing translations for $language language",
'NOTICE');
122 $msg =
elgg_echo(
'ElggPlugin:Exception:CannotRegisterLanguages',
123 array($plugin->getID(), $plugin->guid, $languages_path));
167 if (!isset($CONFIG->language_paths)) {
168 $CONFIG->language_paths = array();
170 $CONFIG->language_paths[
$path] =
true;
172 $language_file =
"{$path}{$language}.php";
174 if (!file_exists($language_file)) {
175 elgg_log(
"Could not find language file: $language_file",
'NOTICE');
180 $result = include_once($language_file);
182 elgg_log(
"Translations loaded from: $language_file",
"INFO");
270 $events->registerHandler(
'init',
'system',
'_elgg_translations_init');
get_current_language()
Detect the current language being used by the current site or logged in user.
_elgg_load_translations_for_language($language)
Load both core and plugin translations for a specific language.
if($guid==elgg_get_logged_in_user_guid()) $name
get_language_completeness($language)
Return the level of completeness for a given language code (compared to english)
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
elgg_language_key_exists($key, $language= 'en')
Check if a give language key exists.
reload_all_translations()
Reload all translations from all registered paths.
$args
Some servers don't allow PHP to check the rewrite, so try via AJAX.
get_missing_language_keys($language)
Return the translation keys missing from a given language, or those that are identical to the english...
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
get_language()
Gets the current language in use by the system or user.
elgg_extend_view($view, $view_extension, $priority=501, $viewtype= '')
Extends a view with another view.
elgg global
Pointer to the global context.
add_translation($country_code, $language_array)
Add a translation.
elgg_log($message, $level= 'NOTICE')
Display or log a message.
_elgg_register_translations_for_language($path, $language)
When given a full path, finds translation files for a language and loads them.
elgg_get_plugins($status= 'active', $site_guid=null)
Returns an ordered list of plugins.
elgg_load_system_cache($type)
Retrieve the contents of a system cache.
_elgg_translations_init()
Initializes simplecache views for translations.
register_translations($path, $load_all=false)
When given a full path, finds translation files and loads them.
get_installed_translations()
Return an array of installed translations as an associative array "two letter code" => "native langua...
$language
$vars['language']