| 26,50 → 26,43 |
| 'de' => 'Deutsch' |
| ); |
| |
| /* Specify location of translation tables */ |
| /* TODO: Use Autoloader */ |
| require_once 'Zend/Stdlib/ErrorHandler.php'; |
| require_once 'Zend/I18n/Translator/TextDomain.php'; |
| require_once 'Zend/I18n/Translator/Loader/FileLoaderInterface.php'; |
| require_once 'Zend/I18n/Translator/Loader/Gettext.php'; |
| require_once 'Zend/ServiceManager/ServiceLocatorAwareInterface.php'; |
| require_once 'Zend/ServiceManager/ServiceLocatorInterface.php'; |
| require_once 'Zend/ServiceManager/ServiceManager.php'; |
| require_once 'Zend/ServiceManager/AbstractPluginManager.php'; |
| require_once 'Zend/I18n/Translator/LoaderPluginManager.php'; |
| require_once 'Zend/I18n/Translator/Translator.php'; |
| |
| $translator = new Zend\I18n\Translator\Translator(); |
| $type = 'gettext'; |
| $baseDir = './LocaleData'; |
| $pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo'; |
| $textDomain = 'de.pointedears'; |
| $baseDir = './LocaleData'; |
| $translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain); |
| |
| if (function_exists('_')) |
| /** |
| * Returns the translation of the parameter, if any, |
| * using Zend Framework 2.1 Translate |
| * @param string $s |
| * @return string |
| */ |
| function tr ($s) |
| { |
| bindtextdomain($textDomain, $baseDir); |
| |
| /* Choose domain */ |
| /* Translation is looking for in ./LocaleData/de/LC_MESSAGES/de.pointedears.mo now */ |
| textdomain($textDomain); |
| } |
| else |
| { |
| /* TODO: Use Autoloader */ |
| require_once 'Zend\Stdlib\ErrorHandler.php'; |
| require_once 'Zend\I18n\Translator\TextDomain.php'; |
| require_once 'Zend\I18n\Translator\Loader\FileLoaderInterface.php'; |
| require_once 'Zend\I18n\Translator\Loader\Gettext.php'; |
| require_once 'Zend\ServiceManager\ServiceLocatorAwareInterface.php'; |
| require_once 'Zend\ServiceManager\ServiceLocatorInterface.php'; |
| require_once 'Zend\ServiceManager\ServiceManager.php'; |
| require_once 'Zend\ServiceManager\AbstractPluginManager.php'; |
| require_once 'Zend\I18n\Translator\LoaderPluginManager.php'; |
| require_once 'Zend\I18n\Translator\Translator.php'; |
| |
| $translator = new Zend\I18n\Translator\Translator(); |
| $type = 'gettext'; |
| $pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo'; |
| $translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain); |
| global $translator; |
| global $textDomain; |
| global $language; |
| |
| function _($s) |
| if ($translator) |
| { |
| global $translator; |
| global $textDomain; |
| global $language; |
| |
| if ($translator) |
| { |
| return $translator->translate($s, $textDomain, $language); |
| } |
| return $translator->translate($s, $textDomain, $language); |
| } |
| |
| return $s; |
| } |
| return $s; |
| } |
| |
| $menu = array( |
| 77,13 → 70,13 |
| 'es-matrix' => array( |
| 'path' => 'es-matrix', |
| 'text' => 'ES Matrix', |
| 'title' => 'ECMAScript Support Matrix: ' . _("A comparison of features of ECMAScript implementations") |
| 'title' => 'ECMAScript Support Matrix: ' . tr("A comparison of features of ECMAScript implementations") |
| ), |
| 'devel' => array('path' => 'devel/', 'text' => _('Other software')), |
| 'devel' => array('path' => 'devel/', 'text' => tr('Other software')), |
| 'series' => array('path' => "media/video/series/", 'text' => 'Seri-o-meter'), |
| 'ufpdb' => array( |
| 'path' => "ufpdb/index.$language", |
| 'text' => 'UFPDB', |
| 'title' => _('United Federation of Planets DataBase') |
| 'title' => tr('United Federation of Planets DataBase') |
| ) |
| ); |