Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Moved language function to languages file
Browse files Browse the repository at this point in the history
  • Loading branch information
KristianP26 committed Dec 11, 2022
1 parent 60ea1fc commit 4de1df9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
28 changes: 0 additions & 28 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']))
Expand Down
28 changes: 28 additions & 0 deletions inc/languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

0 comments on commit 4de1df9

Please sign in to comment.