Rev 140 | Rev 151 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 140 | Rev 141 | ||
---|---|---|---|
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 | ||
- | 33 | if (function_exists('_')) |
|
- | 34 | {
|
|
32 | bindtextdomain($textDomain, $baseDir); |
35 | bindtextdomain($textDomain, $baseDir); |
33 | 36 | ||
34 | /* Choose domain */
|
37 | /* Choose domain */
|
35 | textdomain($textDomain); |
- | |
36 | - | ||
37 | /* Translation is looking for in ./LocaleData/de/LC_MESSAGES/de.pointedears.mo now */
|
38 | /* Translation is looking for in ./LocaleData/de/LC_MESSAGES/de.pointedears.mo now */
|
- | 39 | textdomain($textDomain); |
|
- | 40 | }
|
|
- | 41 | else
|
|
38 | 42 | {
|
|
39 | /* TODO: Use Autoloader */
|
43 | /* TODO: Use Autoloader */
|
40 | // require_once 'Zend\Stdlib\ErrorHandler.php';
|
44 | require_once 'Zend\Stdlib\ErrorHandler.php'; |
41 | // require_once 'Zend\I18n\Translator\TextDomain.php';
|
45 | require_once 'Zend\I18n\Translator\TextDomain.php'; |
42 | // require_once 'Zend\I18n\Translator\Loader\FileLoaderInterface.php';
|
46 | require_once 'Zend\I18n\Translator\Loader\FileLoaderInterface.php'; |
43 | // require_once 'Zend\I18n\Translator\Loader\Gettext.php';
|
47 | require_once 'Zend\I18n\Translator\Loader\Gettext.php'; |
44 | // require_once 'Zend\ServiceManager\ServiceLocatorAwareInterface.php';
|
48 | require_once 'Zend\ServiceManager\ServiceLocatorAwareInterface.php'; |
45 | // require_once 'Zend\ServiceManager\ServiceLocatorInterface.php';
|
49 | require_once 'Zend\ServiceManager\ServiceLocatorInterface.php'; |
46 | // require_once 'Zend\ServiceManager\ServiceManager.php';
|
50 | require_once 'Zend\ServiceManager\ServiceManager.php'; |
47 | // require_once 'Zend\ServiceManager\AbstractPluginManager.php';
|
51 | require_once 'Zend\ServiceManager\AbstractPluginManager.php'; |
48 | // require_once 'Zend\I18n\Translator\LoaderPluginManager.php';
|
52 | require_once 'Zend\I18n\Translator\LoaderPluginManager.php'; |
49 | // require_once 'Zend\I18n\Translator\Translator.php';
|
53 | require_once 'Zend\I18n\Translator\Translator.php'; |
50 | //
|
54 | |
51 | // use Zend\I18n\Translator\Translator;
|
55 | $translator = new Zend\I18n\Translator\Translator(); |
52 | // $translator = new Translator();
|
- | |
53 | // $type = 'gettext';
|
56 | $type = 'gettext'; |
54 | // $pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo';
|
57 | $pattern = '%s/LC_MESSAGES/%1$s.pointedears.mo'; |
55 | // $translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain);
|
58 | $translator->addTranslationFilePattern($type, $baseDir, $pattern, $textDomain); |
56 | 59 | ||
57 | if (!function_exists('_')) |
- | |
58 | {
|
- | |
59 | function _($s) |
60 | function _($s) |
60 | {
|
61 | {
|
61 | global $translator; |
62 | global $translator; |
62 | global $textDomain; |
63 | global $textDomain; |
63 | global $language; |
64 | global $language; |
64 | 65 | ||
- | 66 | if ($translator) |
|
- | 67 | {
|
|
65 | return $translator->translate($s, $textDomain, $language); |
68 | return $translator->translate($s, $textDomain, $language); |
66 | }
|
69 | }
|
- | 70 | ||
- | 71 | return $s; |
|
- | 72 | }
|
|
67 | }
|
73 | }
|
68 | 74 | ||
69 | $menu = array( |
75 | $menu = array( |
70 | 'scripts' => array('path' => 'scripts/', 'text' => 'Scripting'), |
76 | 'scripts' => array('path' => 'scripts/', 'text' => 'Scripting'), |
71 | 'es-matrix' => array( |
77 | 'es-matrix' => array( |