Subversion Repositories LCARS

Rev

Rev 137 | Rev 141 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 137 Rev 140
Line 27... Line 27...
27
);
27
);
28
28
29
/* Specify location of translation tables */
29
/* Specify location of translation tables */
30
$textDomain = 'de.pointedears';
30
$textDomain = 'de.pointedears';
31
$baseDir = './LocaleData';
31
$baseDir = './LocaleData';
32
// bindtextdomain($textdomain, $baseDir);
32
bindtextdomain($textDomain, $baseDir);
33
33
34
/* Choose domain */
34
/* Choose domain */
35
// textdomain("de.pointedears");
35
textdomain($textDomain);
36
36
37
/* Translation is looking for in ./LocaleData/de/LC_MESSAGES/de.pointedears.mo now */
37
/* Translation is looking for in ./LocaleData/de/LC_MESSAGES/de.pointedears.mo now */
38
38
39
/* TODO: Use Autoloader */
39
/* TODO: Use Autoloader */
40
require_once 'Zend\Stdlib\ErrorHandler.php';
40
// require_once 'Zend\Stdlib\ErrorHandler.php';
41
require_once 'Zend\I18n\Translator\TextDomain.php';
41
// require_once 'Zend\I18n\Translator\TextDomain.php';
42
require_once 'Zend\I18n\Translator\Loader\FileLoaderInterface.php';
42
// require_once 'Zend\I18n\Translator\Loader\FileLoaderInterface.php';
43
require_once 'Zend\I18n\Translator\Loader\Gettext.php';
43
// require_once 'Zend\I18n\Translator\Loader\Gettext.php';
44
require_once 'Zend\ServiceManager\ServiceLocatorAwareInterface.php';
44
// require_once 'Zend\ServiceManager\ServiceLocatorAwareInterface.php';
45
require_once 'Zend\ServiceManager\ServiceLocatorInterface.php';
45
// require_once 'Zend\ServiceManager\ServiceLocatorInterface.php';
46
require_once 'Zend\ServiceManager\ServiceManager.php';
46
// require_once 'Zend\ServiceManager\ServiceManager.php';
47
require_once 'Zend\ServiceManager\AbstractPluginManager.php';
47
// require_once 'Zend\ServiceManager\AbstractPluginManager.php';
48
require_once 'Zend\I18n\Translator\LoaderPluginManager.php';
48
// require_once 'Zend\I18n\Translator\LoaderPluginManager.php';
49
require_once 'Zend\I18n\Translator\Translator.php';
49
// require_once 'Zend\I18n\Translator\Translator.php';
50
50
// 
51
use Zend\I18n\Translator\Translator;
51
// use Zend\I18n\Translator\Translator;
52
$translator = new Translator();
52
// $translator = new Translator();
53
$type = 'gettext';
53
// $type = 'gettext';
54
$pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo';
54
// $pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo';
55
$translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain);
55
// $translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain);
56
56
57
function _($s)
57
if (!function_exists('_'))
58
{
58
{
-
 
59
  function _($s)
-
 
60
  {
59
  global $translator;
61
    global $translator;
60
  global $textDomain;
62
    global $textDomain;
61
  global $language;
63
    global $language;
62
 
64
   
63
  return $translator->translate($s, $textDomain, $language);
65
    return $translator->translate($s, $textDomain, $language);
-
 
66
  }
64
}
67
}
65
68
66
$menu = array(
69
$menu = array(
67
  'scripts'   => array('path' => 'scripts/', 'text' => 'Scripting'),
70
  'scripts'   => array('path' => 'scripts/', 'text' => 'Scripting'),
68
  'es-matrix' => array(
71
  'es-matrix' => array(
Line 75... Line 78...
75
  'ufpdb'     => array(
78
  'ufpdb'     => array(
76
    'path'  => "ufpdb/index.$language",
79
    'path'  => "ufpdb/index.$language",
77
    'text'  => 'UFPDB',
80
    'text'  => 'UFPDB',
78
    'title' => _('United Federation of Planets DataBase')
81
    'title' => _('United Federation of Planets DataBase')
79
  )
82
  )
80
);
-
 
81
83
);
-
 
84