Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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['language']
Definition: languages.js.php:6
$vars['entity']
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:1310
$all_translations
Definition: languages.js.php:8
$translations
Definition: languages.js.php:9