Rev 141 | Rev 152 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
63 | PointedEar | 1 | <?php |
2 | |||
3 | $encoding = 'UTF-8'; |
||
4 | header("Content-Type: text/html" . ($encoding ? "; charset=$encoding" : "")); |
||
5 | |||
6 | $modi = max(array( |
||
7 | @filemtime(__FILE__), |
||
106 | PointedEar | 8 | @filemtime('LocaleData'), |
63 | PointedEar | 9 | @filemtime('index.phtml'), |
106 | PointedEar | 10 | @filemtime('styles/lcars-basic.css'), |
11 | @filemtime('styles/lcars22.css'), |
||
12 | @filemtime('styles/lcars-ani.css'), |
||
13 | @filemtime('scripts/object.js'), |
||
63 | PointedEar | 14 | )); |
15 | |||
16 | header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $modi) . ' GMT'); |
||
17 | |||
18 | /* Cached resource expires in HTTP/1.1 caches 24h after last retrieval */ |
||
117 | PointedEar | 19 | header('Cache-Control: max-age=86400, s-maxage=86400, must-revalidate, proxy-revalidate'); |
63 | PointedEar | 20 | |
21 | /* Cached resource expires in HTTP/1.0 caches 24h after last retrieval */ |
||
117 | PointedEar | 22 | header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT'); |
63 | PointedEar | 23 | |
24 | $languages = array( |
||
25 | 'en' => 'English', |
||
26 | 'de' => 'Deutsch' |
||
27 | ); |
||
28 | |||
151 | PointedEar | 29 | /* TODO: Use Autoloader */ |
30 | require_once 'Zend/Stdlib/ErrorHandler.php'; |
||
31 | require_once 'Zend/I18n/Translator/TextDomain.php'; |
||
32 | require_once 'Zend/I18n/Translator/Loader/FileLoaderInterface.php'; |
||
33 | require_once 'Zend/I18n/Translator/Loader/Gettext.php'; |
||
34 | require_once 'Zend/ServiceManager/ServiceLocatorAwareInterface.php'; |
||
35 | require_once 'Zend/ServiceManager/ServiceLocatorInterface.php'; |
||
36 | require_once 'Zend/ServiceManager/ServiceManager.php'; |
||
37 | require_once 'Zend/ServiceManager/AbstractPluginManager.php'; |
||
38 | require_once 'Zend/I18n/Translator/LoaderPluginManager.php'; |
||
39 | require_once 'Zend/I18n/Translator/Translator.php'; |
||
40 | |||
41 | $translator = new Zend\I18n\Translator\Translator(); |
||
42 | $type = 'gettext'; |
||
43 | $baseDir = './LocaleData'; |
||
44 | $pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo'; |
||
137 | PointedEar | 45 | $textDomain = 'de.pointedears'; |
151 | PointedEar | 46 | $translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain); |
63 | PointedEar | 47 | |
151 | PointedEar | 48 | /** |
49 | * Returns the translation of the parameter, if any, |
||
50 | * using Zend Framework 2.1 Translate |
||
51 | * @param string $s |
||
52 | * @return string |
||
53 | */ |
||
54 | function tr ($s) |
||
141 | PointedEar | 55 | { |
151 | PointedEar | 56 | global $translator; |
57 | global $textDomain; |
||
58 | global $language; |
||
141 | PointedEar | 59 | |
151 | PointedEar | 60 | if ($translator) |
140 | PointedEar | 61 | { |
151 | PointedEar | 62 | return $translator->translate($s, $textDomain, $language); |
63 | } |
||
141 | PointedEar | 64 | |
151 | PointedEar | 65 | return $s; |
137 | PointedEar | 66 | } |
67 | |||
63 | PointedEar | 68 | $menu = array( |
71 | PointedEar | 69 | 'scripts' => array('path' => 'scripts/', 'text' => 'Scripting'), |
70 | 'es-matrix' => array( |
||
71 | 'path' => 'es-matrix', |
||
72 | 'text' => 'ES Matrix', |
||
151 | PointedEar | 73 | 'title' => 'ECMAScript Support Matrix: ' . tr("A comparison of features of ECMAScript implementations") |
71 | PointedEar | 74 | ), |
151 | PointedEar | 75 | 'devel' => array('path' => 'devel/', 'text' => tr('Other software')), |
71 | PointedEar | 76 | 'series' => array('path' => "media/video/series/", 'text' => 'Seri-o-meter'), |
77 | 'ufpdb' => array( |
||
63 | PointedEar | 78 | 'path' => "ufpdb/index.$language", |
79 | 'text' => 'UFPDB', |
||
151 | PointedEar | 80 | 'title' => tr('United Federation of Planets DataBase') |
63 | PointedEar | 81 | ) |
140 | PointedEar | 82 | ); |