From 4de1df903fa08328f1bc4eec8c9065872a3c94cb Mon Sep 17 00:00:00 2001 From: KristianP26 Date: Sun, 11 Dec 2022 19:35:03 +0100 Subject: [PATCH] Moved language function to languages file --- inc/functions.php | 28 ---------------------------- inc/languages.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 9ba8977b..5781e0c6 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -144,34 +144,6 @@ function LanguageActive($language): string return ''; } - function LanguageFlag(): string - { - if($_SESSION['language'] == 'Czech') - return 'cz'; - elseif($_SESSION['language'] == 'English') - return 'gb'; - elseif($_SESSION['language'] == 'German') - return 'de'; - elseif($_SESSION['language'] == 'Slovak') - return 'sk'; - elseif($_SESSION['language'] == 'Portuguese') - return 'pt'; - elseif($_SESSION['language'] == 'French') - return 'fr'; - elseif($_SESSION['language'] == 'Turkish') - return 'tr'; - elseif($_SESSION['language'] == 'Danish') - return 'dk'; - elseif($_SESSION['language'] == 'Korean') - return 'kr'; - elseif($_SESSION['language'] == 'Spanish') - return 'es'; - elseif($_SESSION['language'] == 'Swedish') - return 'se'; - else - return 'gb'; - } - function LanguageURL($language): string { if(isset($_GET['map'])||isset($_GET['id'])) diff --git a/inc/languages.php b/inc/languages.php index 8a2dc2a0..e9562cb4 100644 --- a/inc/languages.php +++ b/inc/languages.php @@ -38,3 +38,31 @@ else: require_once require_once(__ROOT__.'/inc/languages/English.php'); endif; + + function LanguageFlag(): string + { + if($_SESSION['language'] == 'Czech') + return 'cz'; + elseif($_SESSION['language'] == 'English') + return 'gb'; + elseif($_SESSION['language'] == 'German') + return 'de'; + elseif($_SESSION['language'] == 'Slovak') + return 'sk'; + elseif($_SESSION['language'] == 'Portuguese') + return 'pt'; + elseif($_SESSION['language'] == 'French') + return 'fr'; + elseif($_SESSION['language'] == 'Turkish') + return 'tr'; + elseif($_SESSION['language'] == 'Danish') + return 'dk'; + elseif($_SESSION['language'] == 'Korean') + return 'kr'; + elseif($_SESSION['language'] == 'Spanish') + return 'es'; + elseif($_SESSION['language'] == 'Swedish') + return 'se'; + else + return 'gb'; + }