mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2026-06-02 22:24:52 -04:00
Objectify locale negotiator and template files, add documentation
This commit is contained in:
+16
-2
@@ -9,13 +9,27 @@ define("MAILER_ADDRESS", "##mailer_email##"); //Mailer address
|
||||
define("INSTALL_OVERRIDE", false);
|
||||
define("DEFAULT_LANGUAGE", "en_GB");
|
||||
|
||||
require("locale.php");
|
||||
require("classes/locale-negotiator.php");
|
||||
|
||||
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");
|
||||
|
||||
bindtextdomain("server-status", __DIR__ . "/locale/");
|
||||
bind_textdomain_codeset($_SESSION['locale'], "utf-8");
|
||||
textdomain("server-status");
|
||||
}
|
||||
|
||||
|
||||
//Database connection
|
||||
$mysqli = new mysqli("##server##","##user##","##password##","##database##");
|
||||
|
||||
if ($mysqli->connect_errno) {
|
||||
printf("Connection failed: %s\n", $mysqli->connect_error);
|
||||
printf(_("Connection failed: %s\n"), $mysqli->connect_error);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user