Files
Wallos/includes/i18n/getlang.php
Miguel Ribeiro c2e85d6e10 feat: support automatic dark mode
refactor: run linter and cleanup php files
fix: not every payment cycle was shown on the calendar
feat: also show previous payments on the calendar for the current month
2024-06-26 18:11:37 +02:00

26 lines
561 B
PHP

<?php
$lang = "en";
if (isset($_COOKIE['language'])) {
$selectedLanguage = $_COOKIE['language'];
if (array_key_exists($selectedLanguage, $languages)) {
$lang = $selectedLanguage;
}
}
function translate($text, $translations)
{
if (array_key_exists($text, $translations)) {
return $translations[$text];
} else {
require 'en.php';
if (array_key_exists($text, $i18n)) {
return $i18n[$text];
} else {
return "[i18n String Missing]";
}
}
}
?>