Elgg
Version 2.3
views
default
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;
9
$translations
=
$all_translations
[
'en'
];
10
11
if
(
$language
!=
'en'
&& !isset(
$all_translations
[
$language
])) {
12
// try to reload missing translations
13
reload_all_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); ?>);
elgg_extract
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
$all_translations
Definition:
languages.js.php:8
$language
$language
@uses $vars['language']
Definition:
languages.js.php:6
$translations
$translations
Definition:
languages.js.php:9
reload_all_translations
reload_all_translations()
Reload all translations from all registered paths.
Definition:
languages.php:83
$vars
$vars['entity']
Definition:
plugin_settings.php:15
Generated on Fri Aug 29 2025 00:00:47 for Elgg by
1.9.1