Add template doc, fixup rendering locale select

This commit is contained in:
Vojtěch Sajdl
2018-01-07 20:43:04 +01:00
parent 61f563c9b0
commit 5dd9a2a1bd
3 changed files with 65 additions and 50 deletions
+2 -1
View File
@@ -11,10 +11,11 @@ define("DEFAULT_LANGUAGE", "en_GB");
require("classes/locale-negotiator.php");
$negotiator = new LocaleNegotiator(DEFAULT_LANGUAGE);
if (!isset($_SESSION['locale'])||isset($_GET['lang']))
{
$override = ((isset($_GET['lang']))?$_GET['lang']:null);
$negotiator = new LocaleNegotiator(DEFAULT_LANGUAGE);
$best_match = $negotiator->negotiate($override);
$_SESSION['locale'] = $best_match;
setlocale(LC_ALL, $_SESSION['locale'].".UTF-8");