Alan Lam 7 лет назад
Родитель
Сommit
a1ec41faa2
3 измененных файлов с 12 добавлено и 2 удалено
  1. 9 0
      engine/core.php
  2. 1 1
      views/header.php
  3. 2 1
      views/maintenance_mode.php

+ 9 - 0
engine/core.php

@@ -155,4 +155,13 @@ class Core {
 		return Core::isProduction() ? "img/icon.png" : "img/dev_icon.png";
 	}
 
+	public static function getLocale(): string {
+		return Core::$user->locale ?? LOCALE;
+	}
+
+	public static function getLang(): string {
+		$parts = explode("_", Core::getLocale());
+		return $parts[0];
+	}
+
 }

+ 1 - 1
views/header.php

@@ -8,7 +8,7 @@ if($print) $body_class = "print";
 
 ?>
 <!DOCTYPE html>
-<html>
+<html lang="<?=htmlspecialchars(Core::getLang())?>">
 	<head>
 		<meta charset="utf-8" />
 		<meta http-equiv="x-ua-compatible" content="ie=edge" />

+ 2 - 1
views/maintenance_mode.php

@@ -1,4 +1,5 @@
-<html>
+<!DOCTYPE html>
+<html lang="<?=htmlspecialchars(Core::getLang())?>">
 	<head>
 
 		<meta charset="utf-8" />