Beispiel #1
0
 public function testAutomaticaly()
 {
     I18n::SetDefault("en");
     I18n::load("en");
     $res = I18n::get_answer_from_google("Bienvenue, veuillez vous identifier\nContacter le créateur de l'application", "fr");
     $this->assertEquals($res[0], "Welcome, please log");
     $this->assertEquals($res[1], "Contact the creator of the application");
 }
Beispiel #2
0
FactoryController::addDi("db", $_DB);
DEBUG ? $_DEBUG->save("Init database") : "";
if (!IS_CLI) {
    include __DIR__ . DS . 'Router.php';
    $route = new router();
    $route->parse($_GET['glial_path']);
    $url = $route->get_routes();
    if (isset($_GET['lg'])) {
        $_SESSION['language'] = $_GET['lg'];
        SetCookie("language", $_GET['lg'], time() + 60 * 60 * 24 * 365, "/", $_SERVER['SERVER_NAME'], false, true);
        //SetCookie("language", $_GET['lg'], time() + 60 * 60 * 24 * 365, "/");
    }
}
DEBUG ? $_DEBUG->save("Rooter loaded") : "";
I18n::injectDb($_DB);
I18n::SetDefault("en");
I18n::SetSavePath(TMP . "translations");
if (empty($_SESSION['language'])) {
    $_SESSION['language'] = "en";
}
$lg = explode(",", LANGUAGE_AVAILABLE);
if (!in_array($_SESSION['language'], $lg)) {
    $_SESSION['URL_404'] = $_SERVER['QUERY_STRING'];
    header("location: " . WWW_ROOT . "en/error/_404/");
}
I18n::load($_SESSION['language']);
DEBUG ? $_DEBUG->save("Language loaded") : "";
//mode with php-cli
if (IS_CLI) {
    if ($_SERVER["argc"] >= 3) {
        $_SYSTEM['controller'] = $_SERVER["argv"][1];