/** * This part has had to be outsourced from the Constructor, * because the called Classes access the core and by * that the Core::instance() method. Thus an endless recursion * occured. because the instance is not already instantiated */ private function postConstruct() { $this->db = Grootdb::instance(); I18N::instance()->addFolder('i18n'); UserHandler::instance(); $this->controller = Controller::instance(); }
<?php require dirname(__FILE__) . '/I18N.php'; I18N::instance('pt_PT'); ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>translate test...</title> </head> <body> <?php echo I18N::translate("I hope it's useful for someone"); ?> </body> </html>
private static function loadFolders() { foreach (static::$folders as $folder) { if (!in_array(static::$lang, $folder['langs'])) { I18N::instance(static::$lang)->loadLanguageFiles($folder); } } }