23,12 → 23,48 |
/* Cached resource expires in HTTP/1.0 caches 24h after last retrieval */ |
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT'); |
|
// $vulcan = 'x-vulcan-latin'; |
$vulcan = 'vuh-Latn-Gol-modern'; |
$languages = array( |
'en' => 'English', |
'de' => 'Deutsch', |
// 'ru' => 'По-русски', |
'ru' => 'по-русски', |
// 'x-klingon-latin' => array( |
// 'key' => 'tlh', |
// 'name' => 'tlhIngan Hol' |
// ), |
$vulcan => array( |
'key' => 'vu', |
'name' => '<abbr title="Gen-lis">G-l</abbr> Vuhlkansu' |
) |
); |
|
|
/** |
* Returns the short language key. |
* |
* Needed for safely mapping extra-terrestrial languages. |
*/ |
function language_key_short ($key) |
{ |
global $languages; |
preg_match('/^[^-]{2,3}/', $key, $matches); |
$language = $languages[$key]; |
return isset($language['key']) ? $language['key'] : $matches[0]; |
} |
|
/** |
* Returns the language name. |
* |
* Needed for safely mapping extra-terrestrial languages. |
*/ |
function language_name ($key) |
{ |
global $languages; |
$language = $languages[$key]; |
return isset($language['name']) ? $language['name'] : $language; |
} |
|
require_once 'Zend/Loader/StandardAutoloader.php'; |
$loader = new Zend\Loader\StandardAutoloader(array('autoregister_zf' => true)); |
$loader->register(); |
48,26 → 84,31 |
* @param string $s |
* @return string |
*/ |
function tr ($s) |
function tr ($s, $lang = null) |
{ |
global $translator; |
global $textDomain; |
global $language; |
|
if ($lang === null) |
{ |
$lang = $language; |
} |
|
/* DEBUG */ |
// echo "return \$translator->translate(\"$s\", \"$textDomain\", \"$language\");<br>\n"; |
|
return $translator->translate($s, $textDomain, $language); |
return $translator->translate($s, $textDomain, $lang); |
} |
|
$menu = array( |
'scripts' => array('path' => 'scripts/', 'text' => 'Scripting'), |
'scripts' => array('path' => 'scripts/', 'text' => tr('Scripting')), |
'es-matrix' => array( |
'path' => 'es-matrix', |
'text' => 'ES Matrix', |
'title' => 'ECMAScript Support Matrix: ' . tr("A comparison of features of ECMAScript implementations") |
), |
'devel' => array('path' => 'websvn/', 'text' => tr('Software projects')), |
'devel' => array('path' => 'wsvn/', 'text' => tr('Software projects')), |
'series' => array('path' => "media/video/series/", 'text' => 'Seri-o-meter'), |
'ufpdb' => array( |
'path' => "ufpdb/index.$language", |