Private
Public Access
1
0

feat: Translation into French of most infos, but not the server debugging infos

This commit is contained in:
gauvainboiche
2026-03-30 16:54:08 +02:00
parent 213d76565c
commit 2757fa2393
3 changed files with 50 additions and 49 deletions

View File

@@ -579,17 +579,17 @@ function applyRevealPayload(cell) {
});
details.classList.remove("details--hidden");
if (!cell.exploitable) {
hint.textContent = `(${cell.x},${cell.y}) not exploitable.`;
details.textContent = `Cell (${cell.x},${cell.y})\n\nStatus: Not exploitable.`;
hint.textContent = `(${cell.x},${cell.y}) Inexploitable`;
details.textContent = `Cell (${cell.x},${cell.y})\n\nStatus : Inexploitable`;
return;
}
if (!cell.hasPlanet) {
hint.textContent = `(${cell.x},${cell.y}) exploitable — empty.`;
details.textContent = `Cell (${cell.x},${cell.y})\n\nStatus: Exploitable\nContains: Nothing`;
hint.textContent = `(${cell.x},${cell.y}) Vide`;
details.textContent = `Cell (${cell.x},${cell.y})\n\nStatus : Vide`;
return;
}
hint.textContent = `(${cell.x},${cell.y}) exploitable — planet revealed.`;
details.textContent = `Cell (${cell.x},${cell.y})\n\nStatus: Exploitable\nContains: Planet\n\n${formatPlanet(cell.planet)}`;
hint.textContent = `(${cell.x},${cell.y}) Planète présente`;
details.textContent = `Cell (${cell.x},${cell.y})\n\nStatus : Planète\n\n${formatPlanet(cell.planet)}`;
}
function showLocalSelection(x, y) {
@@ -597,14 +597,14 @@ function showLocalSelection(x, y) {
details.classList.remove("details--hidden");
if (!isOwnTile(k)) return;
if (!isExploitable(x, y)) {
hint.textContent = `(${x},${y}) not exploitable.`;
details.textContent = `Cell (${x},${y})\n\nStatus: Not exploitable.`;
hint.textContent = `(${x},${y}) Inexploitable`;
details.textContent = `Cell (${x},${y})\n\nStatus : Inexploitable`;
return;
}
const meta = cellMeta(k);
if (!meta?.hasPlanet) {
hint.textContent = `(${x},${y}) exploitable — empty.`;
details.textContent = `Cell (${x},${y})\n\nStatus: Exploitable\nContains: Nothing`;
hint.textContent = `(${x},${y}) Vide`;
details.textContent = `Cell (${x},${y})\n\nStatus : Vide`;
return;
}
let planet = meta.planet;
@@ -612,8 +612,8 @@ function showLocalSelection(x, y) {
const h = hash2u32(x, y, seedU32 ^ 0xa5a5a5a5);
planet = generatePlanet(mulberry32(h));
}
hint.textContent = `(${x},${y}) exploitable — planet.`;
details.textContent = `Cell (${x},${y})\n\nStatus: Exploitable\nContains: Planet\n\n${formatPlanet(planet)}`;
hint.textContent = `(${x},${y}) Planète présente`;
details.textContent = `Cell (${x},${y})\n\nStatus : Planète\n\n${formatPlanet(planet)}`;
}
// ── Canvas click handler ──────────────────────────────────────────────────────
@@ -628,20 +628,20 @@ async function onCanvasClick(ev) {
if (isOwnTile(key)) { showLocalSelection(cell.x, cell.y); return; }
if (cooldownActive()) {
hint.textContent = "Cooldown active — reveal a tile your team already discovered to view stats.";
hint.textContent = "Clic indisponible — attendez la fin du délai ou cliquez sur une tuile déjà découverte.";
return;
}
try {
const res = await apiRevealCell(seedStr, cell.x, cell.y, currentTeam);
if (res.status === 409) {
hint.textContent = "This tile was already discovered by the other team.";
hint.textContent = "Cette tuile a déjà été découverte par votre adversaire.";
await fetchGridForSeed(seedStr);
draw();
return;
}
if (res.status === 410) {
hint.textContent = "World period changed — syncing.";
hint.textContent = "Le serveur change sa base de planètes — synchronisation...";
await refreshFromServer();
return;
}
@@ -687,9 +687,9 @@ export async function refreshFromServer() {
clearCooldown();
resetEconScores();
loadEconScores();
details.textContent = "Stats are hidden until you click a tile.";
details.textContent = "Les stats sont vides jusqu'au clic sur une tuile.";
details.classList.add("details--hidden");
hint.textContent = "World period changed — grid reset. Click a cell in the playfield.";
hint.textContent = "Le monde a été réinitilisaté. Vous pouvez cliquer sur une tuile pour recommencer le jeu.";
}
await fetchGridForSeed(seedStr);
await fetchAndApplyScores();