Elgg  Version 2.3
languages.js.php
Go to the documentation of this file.
1 <?php
6 $language = elgg_extract('language', $vars, 'en');
7 
8 $all_translations = $GLOBALS['_ELGG']->translations;
10 
11 if ($language != 'en' && !isset($all_translations[$language])) {
12  // try to reload missing translations
14  $all_translations = $GLOBALS['_ELGG']->translations;
15 }
16 
17 if ($language != 'en' && isset($all_translations[$language])) {
18  $translations = array_merge($translations, $all_translations[$language]);
19 }
20 
21 ?>
22 define(<?php echo json_encode($translations, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); ?>);
reload_all_translations()
Reload all translations from all registered paths.
Definition: languages.php:83
$language
$vars[&#39;language&#39;]
Definition: languages.js.php:6
$vars['entity']
elgg echo
Translates a string.
Definition: languages.js:48
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375
$all_translations
Definition: languages.js.php:8
define(function(require){var $=require('jquery');$(document).on('change', '#elgg-river-selector', function(){var url=window.location.href;if(window.location.search.length){url=url.substring(0, url.indexOf('?'));}url+= '?'+$(this).val();window.location.href=url;});})
Initiates page reload when river selector value changes core/river/filter.
$translations
Definition: languages.js.php:9