/**
  * Tests Locale->getLanguage()
  */
 public function testGetLanguage()
 {
     $this->assertEquals('EN', $this->Locale->getLanguage());
 }
Beispiel #2
0
 /**
  * Returns the current locale. This is the default locale if
  * no current lcoale has been set or the set current locale has
  * a language code of "mul".
  *
  * @return \TYPO3\FLOW3\I18n\Locale
  */
 public function getCurrentLocale()
 {
     if (!$this->currentLocale instanceof \TYPO3\FLOW3\I18n\Locale || $this->currentLocale->getLanguage() === 'mul') {
         return $this->defaultLocale;
     }
     return $this->currentLocale;
 }
Beispiel #3
0
if ($basename == 'index.php') {
    header('Content-type: text/html; charset=UFT-8', true);
}
// Show errors
error_reporting(E_ALL);
// Includes path
set_include_path('app/' . PATH_SEPARATOR . 'admin/app/' . PATH_SEPARATOR . 'admin/app/ado/' . PATH_SEPARATOR . 'admin/app/control/' . PATH_SEPARATOR . 'admin/app/model/' . PATH_SEPARATOR . 'admin/app/inc/' . PATH_SEPARATOR . 'admin/app/config/' . PATH_SEPARATOR . get_include_path());
// Autload classes
function __autoload($file)
{
    $paths = array('app/', 'admin/app/', 'admin/app/ado/', 'admin/app/control/', 'admin/app/model/', 'admin/app/inc/', 'admin/app/config/');
    foreach ($paths as $path) {
        if (is_file($path . $file . '.class.php')) {
            require $path . $file . '.class.php';
            break;
        }
    }
}
// Debug
function pr($array)
{
    echo '<div style="border:2px solid #000;padding:10px;background:#e1e1e1;margin:10px;">';
    echo '<pre>';
    print_r($array);
    echo '</pre>';
    echo '</div>';
}
// Language
$language = Locale::getLanguage();
// Configuration
require_once 'config.php';