From 1e92786a0e3d0ca0b7abdfba40b4c5be9b42218e Mon Sep 17 00:00:00 2001 From: GreenAsJade Date: Mon, 28 Oct 2024 15:29:21 +1030 Subject: [PATCH] Put log event strings through a decode function, use that to explain a nonintuitive one. --- src/views/Game/GameLog.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/views/Game/GameLog.tsx b/src/views/Game/GameLog.tsx index 50a137811f..6549f079b9 100644 --- a/src/views/Game/GameLog.tsx +++ b/src/views/Game/GameLog.tsx @@ -17,7 +17,7 @@ import * as React from "react"; import moment from "moment"; -import { _, pgettext } from "@/lib/translate"; +import { _, llm_pgettext, pgettext } from "@/lib/translate"; import * as DynamicHelp from "react-dynamic-help"; import { LogEntry } from "@/views/Game"; @@ -135,7 +135,7 @@ export function GameLog({ {moment(entry.timestamp).format("L LTS")} - {entry.event.replace(/_/g, " ")} + {decodeLogEvent(entry.event)} { + if (event === "force_stone_removal_acceptance_abandoned") { + return llm_pgettext( + "Description of an event from the server", + "Forcing stone removal: someone abandoned scoring", + ); + } + return event.replace(/_/g, " "); +}; + // Fields that are only used to enhance the display of other fields, // or aren't used at all. const HIDDEN_LOG_FIELDS = [ @@ -190,7 +201,7 @@ export function LogData({ return; } - // Possibly obvious once you think about it: the "stones" field in `data` referring to + // Possibly obvious once you think about it: the "stones" field in `data` is referring to // "stones that are dead, or have been marked alive" // It'd be better if this was called "marked stones", but that'd be a big change.