Browse Source

Check language in parents directories name

main
Miraty 7 months ago
parent
commit
3ece3cbb71
  1. 14
      mkht.php

14
mkht.php

@ -33,7 +33,7 @@ if (!isset($config['centerIndex']))
$config['centerIndex'] = false;
if (!isset($config['defaultLang']))
$config['defaultLang'] = "en";
$config['defaultLang'] = "";
// Less > CSS
@ -160,11 +160,15 @@ foreach ($pages as $page) {
<html lang="<?php
preg_match("#\.([a-zA-Z-]{2,5})\.#", $pathParts['basename'], $lang);
if (isset($lang[1]))
if (isset($lang[1])) {
echo $lang[1];
else
echo $config['defaultLang'];
} else {
preg_match("#/([a-z]{2})(/|$)#", $pathParts['dirname'], $lang);
if (isset($lang[1]))
echo $lang[1];
else
echo $config['defaultLang'];
}
?>">
<head>

Loading…
Cancel
Save