From 3eee76642ff6229f847ed9a8081b01a5af9f3d11 Mon Sep 17 00:00:00 2001 From: Thijs Raymakers Date: Thu, 27 Feb 2025 01:32:27 +0100 Subject: [PATCH] Add base of site --- index.php | 34 +++++++++++++++++++++++++++++++--- language/en.php | 6 +++++- language/language.php | 8 +++----- language/nl.php | 6 +++++- 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/index.php b/index.php index 2d5c69e..1ed1817 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,20 @@ - + @@ -11,8 +27,20 @@ - + Technologia Incognita - + +
+ + <?= $lang->get(" /> + + +

Technologia Incognita

+ get('SHORT_DESCRIPTION_BODY') ?> + +
+
+ + diff --git a/language/en.php b/language/en.php index 163b4c5..6e7e6c5 100644 --- a/language/en.php +++ b/language/en.php @@ -4,7 +4,11 @@ require_once("language.php"); class English extends Language { public function __construct() { parent::__construct("en"); - $this->keys = array("Test" => "Test EN"); + $this->keys = array( + "SHORT_DESCRIPTION_HEAD" => "TechInc is a hackerspace in Amsterdam.", + "SHORT_DESCRIPTION_BODY" => 'TechInc is a hackerspace in Amsterdam.', + "LOGO_ALT_TEXT" => "Stylized boat's wheel. The handles and spokes have different colors, as if it is decorated with RGB LEDs. At the axle of the wheel is an abstract electronic circuit board." + ); } } diff --git a/language/language.php b/language/language.php index 5c20aad..a615901 100644 --- a/language/language.php +++ b/language/language.php @@ -10,7 +10,7 @@ class Language { } public function get($key) { - return $this->keys[$key]; + return array_key_exists($key, $this->keys) ? $this->keys[$key] : $key; } public static function getPreferredLanguage() { @@ -29,12 +29,10 @@ class Language { switch ($preferredLanguage) { case "nl": - require_once("nl.php"); - return new Dutch(); + return require_once("nl.php"); case "en": default: - require_once("en.php"); - return new English(); + return require_once("en.php"); break; } } diff --git a/language/nl.php b/language/nl.php index aa93fae..2648fad 100644 --- a/language/nl.php +++ b/language/nl.php @@ -4,7 +4,11 @@ require_once("language.php"); class Dutch extends Language { public function __construct() { parent::__construct("nl"); - $this->keys = array("Test" => "Test NL"); + $this->keys = array( + "SHORT_DESCRIPTION_HEAD" => "TechInc is een hackerspace in Amsterdam.", + "SHORT_DESCRIPTION_BODY" => 'TechInc is een hackerspace in Amsterdam.', + "LOGO_ALT_TEXT" => "Gestileerd stuurwiel van een boot. De handgrepen en spaken hebben verschillende kleuren, alsof het is versierd met RGB LED's. Op de as van het wiel zit een abstracte elektronische printplaat." + ); } }