Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
TR
Dil sürümü bölümü basitleştirildi.

EN
The language version section has been simplified.
  • Loading branch information
mertskaplan committed Aug 13, 2024
1 parent 276c71e commit 98b4a21
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@

$root = 'https://lab.mertskaplan.com/multitv/';

if (isset($_GET['lang']) && $_GET['lang'] == 'en') {
$lang = 'en';
} elseif (isset($_GET['lang']) && $_GET['lang'] == 'fr') {
$lang = 'fr';
} elseif (isset($_GET['lang']) && $_GET['lang'] == 'es') {
$lang = 'es';
} else {
$browserLang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$acceptLang = ['tr', 'en', 'fr', 'es'];
$lang = (in_array($browserLang, $acceptLang)) ? $browserLang : 'tr';
}
$acceptLang = ['tr', 'en', 'fr', 'es'];
$lang = $_GET['lang'] ?? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$lang = in_array($lang, $acceptLang) ? $lang : 'tr';

require_once 'i18n/'. $lang .'.php';

Expand Down

0 comments on commit 98b4a21

Please sign in to comment.