Detect user locale

This commit is contained in:
Pierre Rudloff 2017-05-29 21:11:59 +02:00
parent de8c4525d9
commit 68b2cca899
5 changed files with 180 additions and 7 deletions

View file

@ -1,13 +1,9 @@
<?php
$language = 'fr_FR';
putenv('LANG='.$language);
setlocale(LC_ALL, [$language, $language.'.utf8']);
require_once __DIR__.'/vendor/autoload.php';
use Alltube\Config;
use Alltube\Controller\FrontController;
use Alltube\LocaleMiddleware;
use Alltube\PlaylistArchiveStream;
use Alltube\UglyRouter;
use Alltube\ViewFactory;
@ -21,6 +17,7 @@ if (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '/index.ph
stream_wrapper_register('playlist', PlaylistArchiveStream::class);
$app = new App();
$app->add(new LocaleMiddleware());
$container = $app->getContainer();
$config = Config::getInstance();
if ($config->uglyUrls) {