29,41 → 29,38 |
/* Specify location of translation tables */ |
$textDomain = 'de.pointedears'; |
$baseDir = './LocaleData'; |
bindtextdomain($textDomain, $baseDir); |
// bindtextdomain($textdomain, $baseDir); |
|
/* Choose domain */ |
textdomain($textDomain); |
// textdomain("de.pointedears"); |
|
/* Translation is looking for in ./LocaleData/de/LC_MESSAGES/de.pointedears.mo now */ |
|
/* 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'; |
// |
// use Zend\I18n\Translator\Translator; |
// $translator = new Translator(); |
// $type = 'gettext'; |
// $pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo'; |
// $translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain); |
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'; |
|
if (!function_exists('_')) |
use Zend\I18n\Translator\Translator; |
$translator = new Translator(); |
$type = 'gettext'; |
$pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo'; |
$translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain); |
|
function _($s) |
{ |
function _($s) |
{ |
global $translator; |
global $textDomain; |
global $language; |
|
return $translator->translate($s, $textDomain, $language); |
} |
global $translator; |
global $textDomain; |
global $language; |
|
return $translator->translate($s, $textDomain, $language); |
} |
|
$menu = array( |
80,4 → 77,4 |
'text' => 'UFPDB', |
'title' => _('United Federation of Planets DataBase') |
) |
); |
); |