From 96a263f7129fbcf01ef644c531cdcc0a0be59085 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Mon, 25 Nov 2013 19:12:19 +0100 Subject: initial gettext integration --- public/css/style2.css | 1 + public/index.php | 15 +++++++++------ public/pic/flag/de.png | Bin 545 -> 0 bytes public/pic/flag/de_DE.UTF-8.png | Bin 0 -> 545 bytes public/pic/flag/en.png | Bin 599 -> 0 bytes public/pic/flag/en_US.UTF-8.png | Bin 0 -> 599 bytes 6 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 public/pic/flag/de.png create mode 100644 public/pic/flag/de_DE.UTF-8.png delete mode 100644 public/pic/flag/en.png create mode 100644 public/pic/flag/en_US.UTF-8.png (limited to 'public') diff --git a/public/css/style2.css b/public/css/style2.css index 30d6d748..d7cec284 100644 --- a/public/css/style2.css +++ b/public/css/style2.css @@ -33,6 +33,7 @@ a { } .error,.success,.info { + color: #fff; background-color: #333; } diff --git a/public/index.php b/public/index.php index fb4c3c7f..ddb727f8 100644 --- a/public/index.php +++ b/public/index.php @@ -18,6 +18,7 @@ require_once ('includes/view/Shifts_view.php'); require_once ('includes/view/Sprache_view.php'); require_once ('includes/view/User_view.php'); +require_once ('includes/helper/internationalization_helper.php'); require_once ('includes/helper/message_helper.php'); require_once ('includes/helper/error_helper.php'); @@ -30,6 +31,8 @@ require_once ('includes/pages/user_messages.php'); session_start(); +gettext_init(); + sql_connect($config['host'], $config['user'], $config['pw'], $config['db']); load_auth(); @@ -37,7 +40,7 @@ load_auth(); // JSON Authorisierung gewünscht? if (isset($_REQUEST['auth'])) json_auth_service(); - + // Gewünschte Seite/Funktion $p = isset($user) ? "news" : "login"; if (isset($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && ($_REQUEST['p'] == 'stats' || (sql_num_query("SELECT * FROM `Privileges` WHERE `name`='" . sql_escape($_REQUEST['p']) . "' LIMIT 1") > 0))) @@ -163,26 +166,26 @@ elseif (in_array($p, $privileges)) { // Hinweis für ungelesene Nachrichten if (isset($user) && $p != "user_messages") $content = user_unread_messages() . $content; - + // Hinweis für Engel, die noch nicht angekommen sind if (isset($user) && $user['Gekommen'] == 0) $content = error("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already.", true) . $content; - + // Erzengel Hinweis für unbeantwortete Fragen if (isset($user) && $p != "admin_questions") $content = admin_new_questions() . $content; - + // Erzengel Hinweis für freizuschaltende Engeltypen if (isset($user) && $p != "admin_user_angeltypes") $content = admin_new_user_angeltypes() . $content; -echo template_render('../templates/layout.html', array ( +echo template_render('../templates/layout.html', array( 'theme' => isset($user) ? $user['color'] : $default_theme, 'title' => $title, 'atom_link' => ($p == 'news' || $p == 'user_meetings') ? '' : '', 'menu' => make_menu(), 'content' => $content, - 'header_toolbar' => header_toolbar() + 'header_toolbar' => header_toolbar() )); counter(); diff --git a/public/pic/flag/de.png b/public/pic/flag/de.png deleted file mode 100644 index ac4a9773..00000000 Binary files a/public/pic/flag/de.png and /dev/null differ diff --git a/public/pic/flag/de_DE.UTF-8.png b/public/pic/flag/de_DE.UTF-8.png new file mode 100644 index 00000000..ac4a9773 Binary files /dev/null and b/public/pic/flag/de_DE.UTF-8.png differ diff --git a/public/pic/flag/en.png b/public/pic/flag/en.png deleted file mode 100644 index ff701e19..00000000 Binary files a/public/pic/flag/en.png and /dev/null differ diff --git a/public/pic/flag/en_US.UTF-8.png b/public/pic/flag/en_US.UTF-8.png new file mode 100644 index 00000000..ff701e19 Binary files /dev/null and b/public/pic/flag/en_US.UTF-8.png differ -- cgit v1.2.3-54-g00ecf