summaryrefslogtreecommitdiff
path: root/includes/language.inc
blob: 424af3b3c6b461a0513b52e37611bac4a6daa56a (plain)
1
2
3
4
5
6
7
8
9
10
<?php

$default = "en";

$lf = $_COOKIE['PEH2_LANGUAGE'] ?? $default;

if (str_contains("/", $lf)) $lf = "en";
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/i18n/" . $lf . ".json")) $lf = "en";

$lang = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/i18n/" . $lf . ".json"), true);