Elgg  Version 1.9
languages.php
Go to the documentation of this file.
1 <?php
7 $language = $vars['language'];
9 
10 // @todo add server-side caching
11 if ($lastcache) {
12  // we're relying on lastcache changes to predict language changes
13  $etag = '"' . md5("$language|$lastcache") . '"';
14 
15  header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', strtotime("+6 months")), true);
16  header("Pragma: public", true);
17  header("Cache-Control: public", true);
18  header("ETag: $etag");
19 
20  if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) === $etag) {
21  header("HTTP/1.1 304 Not Modified");
22  exit;
23  }
24 }
25 
28 
29 if ($language != 'en') {
31 }
32 ?>
33 define(<?php echo json_encode($translations); ?>);
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$translations
Definition: languages.php:27
exit
Definition: reorder.php:12
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1464
if($lastcache) $all_translations
Definition: languages.php:26
elgg echo
Translates a string.
Definition: languages.js:43
$lastcache
Definition: languages.php:8
clearfix elgg elgg elgg elgg page header
Definition: admin.php:127
$language
$vars[&#39;language&#39;] $vars[&#39;lc&#39;] if present, client will be sent long expires headers ...
Definition: languages.php:7
if(file_exists($welcome)) $vars
Definition: upgrade.php:93