diff options
author | Minteck <contact@minteck.org> | 2022-06-08 19:37:54 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-06-08 19:37:54 +0200 |
commit | e78af7b6f3f775ccb8703091124c84ea9d1b59dd (patch) | |
tree | 0b6f74b3778ca3f700507fb7f8768d4670a12534 /news_internal/index.php | |
parent | 1efab479fd6a90504472f3dd193028d756d03caa (diff) | |
download | core-e78af7b6f3f775ccb8703091124c84ea9d1b59dd.tar.gz core-e78af7b6f3f775ccb8703091124c84ea9d1b59dd.tar.bz2 core-e78af7b6f3f775ccb8703091124c84ea9d1b59dd.zip |
Improve i18n a bit more
Diffstat (limited to 'news_internal/index.php')
-rw-r--r-- | news_internal/index.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/news_internal/index.php b/news_internal/index.php index 63b691a..c5016d8 100644 --- a/news_internal/index.php +++ b/news_internal/index.php @@ -26,6 +26,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/private/session.php"; +global $_FRENCH; /** @var string $_FULLNAME * @var string $_USER @@ -37,7 +38,13 @@ if (isset($_GET['a'])) { if (!str_contains($_GET['a'], "/") && !str_contains($_GET['a'], ".")) { if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $_GET['a'] . ".json")) { $data = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $_GET['a'] . ".json"), true); - $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $_GET['a'] . ".html"); + + if (!$_FRENCH && file_exists($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $_GET['a'] . ".en.html")) { + $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $_GET['a'] . ".en.html"); + } else { + $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $_GET['a'] . ".html"); + } + $summary = trim(explode("<!---->", $html)[0]); $full = trim($html); if (!($data["limited"] === null || in_array($_USER, $data["limited"]))) { |