summaryrefslogtreecommitdiff
path: root/includes/system
diff options
context:
space:
mode:
Diffstat (limited to 'includes/system')
-rw-r--r--includes/system/compare.inc138
-rw-r--r--includes/system/history.inc46
-rw-r--r--includes/system/species.inc16
-rw-r--r--includes/system/subsystem.inc2
-rw-r--r--includes/system/tree.inc14
5 files changed, 122 insertions, 94 deletions
diff --git a/includes/system/compare.inc b/includes/system/compare.inc
index d7fbdc6..4f9711d 100644
--- a/includes/system/compare.inc
+++ b/includes/system/compare.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling;
+<?php global $system; global $lang; global $pages; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:compare"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling;
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
@@ -19,75 +19,69 @@ function getMember(string $id) {
<br>
<div class="container">
- <h2>Compare members of the <?= $systemCommonName ?></h2>
+ <h2><?= $lang["compare"]["title"] ?> <?= $systemCommonName ?></h2>
<div class="comparison">
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Member</span>
- <span class="comparison-header-l1">Member</span>
- <span class="comparison-header-l2">Member</span>
- <span class="comparison-header-l3">Member</span>
- <span class="comparison-header-l4">Member</span>
- <span class="comparison-header-l5"><abbr title="Member" data-bs-toggle="tooltip">Mmbr.</abbr></span>
+ <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["member"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["member"][5] ?></abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Species</span>
- <span class="comparison-header-l1">Species</span>
- <span class="comparison-header-l2">Species</span>
- <span class="comparison-header-l3">Species</span>
- <span class="comparison-header-l4"><abbr title="Species" data-bs-toggle="tooltip">Spec.</abbr></span>
- <span class="comparison-header-l5"><abbr title="Species" data-bs-toggle="tooltip">Spec.</abbr></span>
+ <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["species"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["species"][5] ?></abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Relations</span>
- <span class="comparison-header-l1">Relations</span>
- <span class="comparison-header-l2">Relations</span>
- <span class="comparison-header-l3">Relations</span>
- <span class="comparison-header-l4"><abbr title="Relations" data-bs-toggle="tooltip">Relt.</abbr></span>
- <span class="comparison-header-l5"><abbr title="Relations" data-bs-toggle="tooltip">Relt.</abbr></span>
+ <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["relations"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["relations"][5] ?></abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Memory</span>
- <span class="comparison-header-l1">Memory</span>
- <span class="comparison-header-l2">Memory</span>
- <span class="comparison-header-l3">Memory</span>
- <span class="comparison-header-l4"><abbr title="Memory" data-bs-toggle="tooltip">Mem.</abbr></span>
- <span class="comparison-header-l5"><abbr title="Memory" data-bs-toggle="tooltip">Mem.</abbr></span>
+ <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["memory"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["memory"][5] ?></abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Fictive</span>
- <span class="comparison-header-l1">Fictive</span>
- <span class="comparison-header-l2">Fictive</span>
- <span class="comparison-header-l3">Fictive</span>
- <span class="comparison-header-l4"><abbr title="Fictive" data-bs-toggle="tooltip">Fic.</abbr></span>
- <span class="comparison-header-l5"><abbr title="Fictive" data-bs-toggle="tooltip">Fic.</abbr></span>
+ <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["fictive"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["fictive"][5] ?></abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Little</span>
- <span class="comparison-header-l1">Little</span>
- <span class="comparison-header-l2">Little</span>
- <span class="comparison-header-l3">Little</span>
- <span class="comparison-header-l4"><abbr title="Little" data-bs-toggle="tooltip">Ltl.</abbr></span>
- <span class="comparison-header-l5"><abbr title="Little" data-bs-toggle="tooltip">Ltl.</abbr></span>
+ <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["little"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["little"][5] ?></abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0">Protector</span>
- <span class="comparison-header-l1">Protector</span>
- <span class="comparison-header-l2"><abbr title="Protector" data-bs-toggle="tooltip">Protect.</abbr></span>
- <span class="comparison-header-l3"><abbr title="Protector" data-bs-toggle="tooltip">Protect.</abbr></span>
- <span class="comparison-header-l4"><abbr title="Protector" data-bs-toggle="tooltip">Prt.</abbr></span>
- <span class="comparison-header-l5"><abbr title="Protector" data-bs-toggle="tooltip">Prt.</abbr></span>
+ <span class="comparison-header-l0"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][0] ?></abbr></span>
+ <span class="comparison-header-l1"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][1] ?></abbr></span>
+ <span class="comparison-header-l2"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][2] ?></abbr></span>
+ <span class="comparison-header-l3"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][3] ?></abbr></span>
+ <span class="comparison-header-l4"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][4] ?></abbr></span>
+ <span class="comparison-header-l5"><abbr title="<?= $lang["compare"]["protector"][0] ?>" data-bs-toggle="tooltip"><?= $lang["compare"]["protector"][5] ?></abbr></span>
</span>
<?php foreach (scoreOrder($members, $systemID) as $member):
$metadata = $member["_metadata"];
- if ($member["name"] === "scootaloo") {
- if ((int)date('j') % 2 === 0) {
- $metadata["marefriends"] = array_reverse($metadata["marefriends"]);
- }
- }
-
?>
<a title="<?= $member["display_name"] ?? $member["name"] ?>" data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="/<?= $member["name"] ?>">
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><span class="comparison-name-full"><?= $member["display_name"] ?? $member["name"] ?></span><span class="comparison-name-small"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></span>
@@ -97,27 +91,27 @@ function getMember(string $id) {
<?php foreach ($metadata["species"] ?? [] as $species): ?>
<img data-bs-toggle="tooltip" title="<?php switch ($species) {
case "earth":
- if ($metadata["robot"]) echo "Robot earth pony"; else if ($metadata["plush"]) echo "Earth pony plush"; else echo "Earth pony";
+ if ($metadata["robot"]) echo $lang["species"]["earth"][0]; else if ($metadata["plush"]) echo $lang["species"]["earth"][1]; else echo $lang["species"]["earth"][2];
break;
case "alicorn":
- if ($metadata["robot"]) echo "Robot alicorn"; else if ($metadata["plush"]) echo "Alicorn plush"; else echo "Alicorn";
+ if ($metadata["robot"]) echo $lang["species"]["alicorn"][0]; else if ($metadata["plush"]) echo $lang["species"]["alicorn"][1]; else echo $lang["species"]["alicorn"][2];
break;
case "crystal":
- if ($metadata["robot"]) echo "Robot crystal pony"; else if ($metadata["plush"]) echo "Crystal pony plush"; else echo "Crystal pony";
+ if ($metadata["robot"]) echo $lang["species"]["crystal"][0]; else if ($metadata["plush"]) echo $lang["species"]["crystal"][1]; else echo $lang["species"]["crystal"][2];
break;
case "pegasus":
- if ($metadata["robot"]) echo "Robot pegasus"; else if ($metadata["plush"]) echo "Pegasus plush"; else echo "Pegasus";
+ if ($metadata["robot"]) echo $lang["species"]["pegasus"][0]; else if ($metadata["plush"]) echo $lang["species"]["pegasus"][1]; else echo $lang["species"]["pegasus"][2];
break;
case "batpony":
- if ($metadata["robot"]) echo "Robot bat pony"; else if ($metadata["plush"]) echo "Bat pony plush"; else echo "Bat pony";
+ if ($metadata["robot"]) echo $lang["species"]["batpony"][0]; else if ($metadata["plush"]) echo $lang["species"]["batpony"][1]; else echo $lang["species"]["batpony"][2];
break;
case "unicorn":
- if ($metadata["robot"]) echo "Robot unicorn"; else if ($metadata["plush"]) echo "Unicorn plush"; else echo "Unicorn";
+ if ($metadata["robot"]) echo $lang["species"]["unicorn"][0]; else if ($metadata["plush"]) echo $lang["species"]["unicorn"][1]; else echo $lang["species"]["unicorn"][2];
break;
default:
@@ -135,51 +129,51 @@ function getMember(string $id) {
<?php $index = 0; foreach ($metadata["marefriends"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
global $mfMemberID;
return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][0] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
global $mfMemberID;
return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["caretakers"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][1] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["caretakers"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) {
global $mfMemberID;
return $item["id"] === $mfMemberID;
- }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?>
+ }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br><?= $lang["compare"]["status"][2] ?>" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?>
</span>
</span>
<span class="comparison-item">
<?php if ($metadata["shared_memory"] > 0): ?>
<?php if ($metadata["shared_memory"] === 1): ?>
- <img data-bs-toggle="tooltip" title="Partial" src="/assets/icons/partial.svg" alt="Partial" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][1] ?>" src="/assets/icons/partial.svg" alt="<?= $lang["compare"]["state"][1] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
<?php endif; ?>
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" style="width:24px;">
<?php endif; ?>
</span>
<span class="comparison-item">
<?php if ($metadata["fictive"]): ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" style="width:24px;">
<?php endif; ?>
</span>
<span class="comparison-item">
- <?php if ($metadata["little"] >= 2): ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
- <?php elseif ($metadata["little"] === 1): ?>
- <img data-bs-toggle="tooltip" title="Age regressor" src="/assets/icons/partial.svg" alt="Partial" style="width:24px;">
+ <?php if ($metadata["little"] === 2): ?>
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
+ <?php elseif ($metadata["little"] === 3): ?>
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][3] ?>" src="/assets/icons/partial.svg" alt="<?= $lang["compare"]["state"][1] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" style="width:24px;">
<?php endif; ?>
</span>
<span class="comparison-item">
<?php if ($metadata["protector"]): ?>
<?php if ($travelling[$member["id"]]["travelling"]): ?>
- <img data-bs-toggle="tooltip" title="Yes, but currently travelling" src="/assets/icons/partial.svg" alt="Yes, but currently travelling" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][4] ?>" src="/assets/icons/partial.svg" alt="<?= $lang["compare"]["state"][4] ?>" style="width:24px;">
<?php else: ?>
- <img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][0] ?>" src="/assets/icons/complete.svg" alt="<?= $lang["compare"]["state"][0] ?>" style="width:24px;">
<?php endif; ?>
<?php else: ?>
- <img data-bs-toggle="tooltip" title="No" src="/assets/icons/none.svg" alt="No" style="width:24px;">
+ <img data-bs-toggle="tooltip" title="<?= $lang["compare"]["state"][2] ?>" src="/assets/icons/none.svg" alt="<?= $lang["compare"]["state"][2] ?>" style="width:24px;">
<?php endif; ?>
</span>
<?php endforeach; ?>
diff --git a/includes/system/history.inc b/includes/system/history.inc
index 31a7c73..b66b8c4 100644
--- a/includes/system/history.inc
+++ b/includes/system/history.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"] . " · " . $systemCommonName; global $systemID; $title = "Front history · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
function getMember(string $id) {
global $systemID;
@@ -28,6 +28,40 @@ function getMember(string $id) {
}
});
+ function frenchIfRequired($original) {
+ global $lang;
+
+ if ($lang["_french"]) {
+ if ($original === "Today") return "Aujourd'hui";
+ if ($original === "Yesterday") return "Hier";
+
+ $original = str_replace("Jan", "janv.", $original);
+ $original = str_replace("Feb", "fév.", $original);
+ $original = str_replace("Mar", "mars", $original);
+ $original = str_replace("Apr", "avr.", $original);
+ $original = str_replace("May", "mai", $original);
+ $original = str_replace("Jun", "juin", $original);
+ $original = str_replace("Jul", "juil.", $original);
+ $original = str_replace("Aug", "août", $original);
+ $original = str_replace("Sep", "sept.", $original);
+ $original = str_replace("Oct", "oct.", $original);
+ $original = str_replace("Nov", "nov.", $original);
+ $original = str_replace("Dec", "déc.", $original);
+
+ $original = str_replace("Mon", "Lun.", $original);
+ $original = str_replace("Tue", "Mar.", $original);
+ $original = str_replace("Wed", "Mer.", $original);
+ $original = str_replace("Thu", "Jeu.", $original);
+ $original = str_replace("Fri", "Ven.", $original);
+ $original = str_replace("Sat", "Sam.", $original);
+ $original = str_replace("Sun", "Dim.", $original);
+
+ return $original;
+ } else {
+ return $original;
+ }
+ }
+
function getSwitchesForDay(int $day) {
global $switches;
@@ -76,9 +110,9 @@ function getMember(string $id) {
}
?>
- <h2>Front history in the <?= $systemCommonName ?></h2>
+ <h2><?= $lang["history"]["title"] ?> <?= $systemCommonName ?></h2>
<div class="alert alert-warning" id="timezone" style="display: none;">
- Times on this page are now shown using your local timezone (<span id="timezone-name">-</span>). Days start at <span id="day-start">-</span> (00:00 on UTC).
+ <?= str_replace("%1", '<span id="timezone-name">-</span>', str_replace("%2", '<span id="day-start">-</span>', $lang["history"]["timezone"])) ?>
<script>
document.getElementById("day-start").innerText = new Date(<?= strtotime(date('Y-m-d')) ?> * 1000).toTimeString().substring(0, 5);
document.getElementById("timezone-name").innerText = new Date().toTimeString().split("(")[1].split(")")[0];
@@ -99,7 +133,7 @@ function getMember(string $id) {
$switchesDay = getSwitchesForDay($day[1]);
$switchesDay[] = getSwitchBefore($switchesDay[count($switchesDay) - 1]["id"]);
?>
- <h4 style="margin-top:15px;"><?= $day[0] ?></h4>
+ <h4 style="margin-top:15px;"><?= frenchIfRequired($day[0]) ?></h4>
<?php foreach ($switchesDay as $switch): $switch["timestamp"] = strtotime($switch["timestamp"]); ?>
<?php if (isset($switch["members"][0])): $member = getMemberWithoutSystem($switch["members"][0]); ?>
<div class="fronter">
@@ -111,7 +145,7 @@ function getMember(string $id) {
<img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?>
</a>
<?php if (count($switch["members"]) > 1): ?>
- (with
+ (<?= $lang["system"]["with"] ?>
<?php if (isset($switch["members"][1])): $member2 = getMember($switch["members"][1]); ?><a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][2])): $member2 = getMember($switch["members"][2]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?><?php if (isset($switch["members"][3])): $member2 = getMember($switch["members"][3]); ?>, <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a><?php endif; ?>)
<?php endif; ?>
</span>
@@ -122,7 +156,7 @@ function getMember(string $id) {
<?= isNotToday($switch["timestamp"], $day[1]) ? "00:00" : date('H:i', $switch["timestamp"]) ?>
</span>
<span class="fronter-profile" style="vertical-align: middle;">
- <span class="text-muted">Fallback pony</span>
+ <span class="text-muted"><?= $lang["history"]["fallback"] ?></span>
</span>
</div>
<?php endif; ?>
diff --git a/includes/system/species.inc b/includes/system/species.inc
index fb1ba69..45a0178 100644
--- a/includes/system/species.inc
+++ b/includes/system/species.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:species"]["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling;
+<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:species"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling;
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
$members = scoreOrder($members, $systemID);
@@ -36,7 +36,7 @@ function species(array $members, string $id, string $name) { global $systemID; g
<br>
<div class="container" id="page-content">
- <h2><?= $systemCommonName ?> members by species</h2>
+ <h2><?= str_replace("%1", $systemCommonName, $lang["species_compare"]["title"]) ?></h2>
<?php
$earth = [];
@@ -59,12 +59,12 @@ function species(array $members, string $id, string $name) { global $systemID; g
?>
- <?php species($earth, "earth", "Earth ponies"); ?>
- <?php species($pegasus, "pegasus", "Pegasi"); ?>
- <?php species($unicorn, "unicorn", "Unicorns"); ?>
- <?php species($alicorn, "alicorn", "Alicorns"); ?>
- <?php species($batpony, "batpony", "Bat ponies"); ?>
- <?php species($crystal, "crystal", "Crystal ponies"); ?>
+ <?php species($earth, "earth", $lang["species"]["earth"][3]); ?>
+ <?php species($pegasus, "pegasus", $lang["species"]["pegasus"][3]); ?>
+ <?php species($unicorn, "unicorn", $lang["species"]["unicorn"][3]); ?>
+ <?php species($alicorn, "alicorn", $lang["species"]["alicorn"][3]); ?>
+ <?php species($batpony, "batpony", $lang["species"]["batpony"][3]); ?>
+ <?php species($crystal, "crystal", $lang["species"]["crystal"][3]); ?>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/system/subsystem.inc b/includes/system/subsystem.inc
index b7d73f1..3269df7 100644
--- a/includes/system/subsystem.inc
+++ b/includes/system/subsystem.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $parts; global $systemID;
+<?php global $system; global $systemCommonName; global $lang; global $pages; global $parts; global $systemID;
if (str_ends_with($_GET['_'], "/subsystem")) header("Location: /?error=Invalid subsystem ID") and die();
diff --git a/includes/system/tree.inc b/includes/system/tree.inc
index 92e7c08..6a2d1cc 100644
--- a/includes/system/tree.inc
+++ b/includes/system/tree.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:tree"]["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:tree"]["name"][$lang["_name"]] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
$members = scoreOrder($members, $systemID);
@@ -61,16 +61,16 @@ function getMemberSubsystem(array $member) {
<br>
<div class="container" id="page-content">
- <h2>System tree for the <?= $systemCommonName ?></h2>
+ <h2><?= $lang["tree"]["title"] ?> <?= $systemCommonName ?></h2>
<a class="tree-root member-link" href="/<?= $system ?>">
- <img src="/assets/uploads/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $system . ".png") ? $system : "" ?>.png" style="width:24px;"> <span style="vertical-align: middle;"><?= $systemCommonName ?></span></a>
+ <img src="/assets/uploads/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $system . ".png") ? $system : "" ?>.png" style="height:24px;"> <span style="vertical-align: middle;"><?= $systemCommonName ?></span></a>
<?php $first = true; ?>
<?php foreach ($subsystems as $subsystem): if ($subsystem["source_type"] === "trait"): ?>
<div class="tree-l0">
<div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $systemID === "gdapd" ? "raindrops" : "cloudburst" ?>/-/subsystem/<?= $subsystem["source"] ?>">
- <img src="/assets/uploads/ss-<?= $subsystem["source"] ?>.png" style="width:24px;border-radius:5px;"> <span style="vertical-align: middle;"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true)["name"] : $subsystem["source"] ?></span>
+ <img src="/assets/uploads/ss-<?= $subsystem["source"] ?>.png" style="height:24px;border-radius:5px;"> <span style="vertical-align: middle;"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true)["name"] : $subsystem["source"] ?></span>
</a>
</div>
<?php $ssfirst = true; foreach ($subsystem["members"] as $ssm): $ssmember = getMember($ssm); ?>
@@ -79,7 +79,7 @@ function getMemberSubsystem(array $member) {
<div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $ssmember["name"] ?>">
- <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
+ <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
</a>
</div>
</div>
@@ -91,7 +91,7 @@ function getMemberSubsystem(array $member) {
<div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $member["name"] ?>">
- <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $member["display_name"] ?? $member["name"] ?></span>
+ <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $member["display_name"] ?? $member["name"] ?></span>
</a>
</div>
<?php if (memberHasSubsystem($member)): ?>
@@ -101,7 +101,7 @@ function getMemberSubsystem(array $member) {
<div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>">&nbsp;</div>
<div class="tree-inner">
<a class="member-link" href="/<?= $ssmember["name"] ?>">
- <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
+ <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
</a>
</div>
</div>