1
0
Alan Lam 7 жил өмнө
parent
commit
a1ec41faa2

+ 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" />