Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4007e5d
i18n: translate Campaigns concerned and language names in EmbeddingLa…
bkruggel Nov 20, 2026
19799ab
i18n: wire UI components for items 1, 2, 5, 9, 15
bkruggel Nov 20, 2026
c99b1a4
i18n: wire harness, speech guillemet cleanup, and system message matc…
bkruggel Nov 20, 2026
da85e21
i18n: fix hand-core enemy turn check, attack lines, and target notes …
bkruggel Nov 20, 2026
0a9f081
i18n: wire hand.ts, BoardChrome, HandAimBar, EncounterPanel, and Mons…
bkruggel Nov 20, 2026
0da2b89
i18n: add composeDisplaySentence and PlayerMessage action translation…
bkruggel Nov 20, 2026
f47d4d8
i18n(fr): add French translation delta to i18n/fr-sync
bkruggel Nov 21, 2026
0d35996
chore(i18n): verify automated write access on i18n/fr-sync
bkruggel Nov 21, 2026
05f61da
Merge branch 'main' into i18n/fr-sync
github-actions[bot] Nov 21, 2026
9dd8d54
i18n(fr): translate all 254 missing keys for 0.39.0 and playtest foll…
bkruggel Nov 21, 2026
da0e5b6
i18n(fr): wire EncounterPanel UI strings and fix Intimidating Presenc…
bkruggel Nov 21, 2026
2c6f24c
i18n(fr): apply automated French translation delta
github-actions[bot] Nov 21, 2026
8a26a69
fix(i18n): resolve TypeScript errors and static audit test failures o…
bkruggel Nov 21, 2026
839ac34
fix(i18n): resolve remaining static audit failures in hand-play.ts an…
bkruggel Nov 21, 2026
880c5e2
chore(test): update name-lookups and text-comparisons audit manifests…
bkruggel Nov 21, 2026
cdadcee
fix(i18n): translate combat stand-still, death save, fall, and round-…
bkruggel Nov 21, 2026
cdb5e6e
fix(i18n): translate rest notes, duration units, and calendar terms i…
bkruggel Nov 21, 2026
6e422e3
fix(i18n): translate comes round with hit point(s) system note
bkruggel Nov 21, 2026
e071889
fix(i18n): preserve space after period in MessageParts system note re…
bkruggel Nov 21, 2026
c799ff3
fix(i18n): translate rage ends system note
bkruggel Nov 21, 2026
358bdec
fix(i18n): translate reach and range refusal reasons in CardReturnedNote
bkruggel Nov 21, 2026
e48686f
fix(i18n): translate system lines in cinematic chronicle panel
bkruggel Nov 21, 2026
5e2f43a
fix(i18n): preserve comma on guillemet speech cards and translate loo…
bkruggel Nov 21, 2026
3d5c3a7
fix(i18n): lazy-load MessageParts in CinematicParts to stay within ta…
bkruggel Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/name-lookups.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
"app/campaigns/[campaignId]/BoardStageLayers.tsx#first": [["key",1,"the first icon file of a family (no record chosen)"]],
"app/campaigns/[campaignId]/CalendarSection.tsx#number": [["key",2,"digits a regex already captured, ids, headers, stored and form numbers (number inputs), dice parts, the pack's English text (\"1,000 feet\", a purse); src/: every site read"]],
"app/campaigns/[campaignId]/CalendarSection.tsx#partial": [["key",1,"UI keys, ids, refs, view choices and documented defaults (a palette, a tile, a peer volume, the first sheet)"]],
"app/campaigns/[campaignId]/CardReturnedNote.tsx#partial": [["pattern",2,"a fixed pattern over DB-stored English card-return reach/range refusal lines"]],
"app/campaigns/[campaignId]/CharacterSheetDialog.tsx#number": [["key",1,"digits a regex already captured, ids, headers, stored and form numbers (number inputs), dice parts, the pack's English text (\"1,000 feet\", a purse); src/: every site read"]],
"app/campaigns/[campaignId]/CharacterVoices.tsx#keyed": [["key",2,"ids, refs, slugs, tool names, field names, env names, event kinds, UI keys, caches, door and map keys; a sheet's conditionMeta by the condition key it was written under; the usage route's gear map by the sheet's own stored item names (src/: every site read)"]],
"app/campaigns/[campaignId]/CharacterVoices.tsx#whole": [["key",1,"UI keys, ids, refs, view choices and documented defaults (a palette, a tile, a peer volume, the first sheet)"]],
Expand Down Expand Up @@ -510,10 +511,11 @@
"app/campaigns/[campaignId]/MarketShopEditor.tsx#whole": [["identity",2,"a stock line by whole name"]],
"app/campaigns/[campaignId]/MessageActions.tsx#whole": [["key",1,"UI keys, ids, refs, view choices and documented defaults (a palette, a tile, a peer volume, the first sheet)"]],
"app/campaigns/[campaignId]/MessageContent.tsx#partial": [["key",1,"UI keys, ids, refs, view choices and documented defaults (a palette, a tile, a peer volume, the first sheet)"]],
"app/campaigns/[campaignId]/MessageParts.tsx#keyed": [["key",2,"condition word lookup in translateConditionWord"]],
"app/campaigns/[campaignId]/MessageParts.tsx#partial": [
[
"pattern",
7,
21,
"a fixed pattern over text that reads no record's name: its English words are scripts/text-comparisons.json's to classify"
],
[
Expand Down Expand Up @@ -961,6 +963,7 @@
"components/InviteShareDialog.tsx#partial": [["key",2,"UI keys, file names, glyphs and markdown"]],
"components/NotificationBell.tsx#partial": [["key",5,"UI keys, file names, glyphs and markdown"]],
"components/SafetyToneFields.tsx#partial": [["key",1,"UI keys, file names, glyphs and markdown"]],
"components/SceneTitle.tsx#partial": [["pattern",3,"a fixed pattern over server title-card labels (Chapter / Act / End of Act)"]],
"components/ScheduleSection.tsx#number": [["key",1,"digits a regex already captured, ids, headers, stored and form numbers (number inputs), dice parts, the pack's English text (\"1,000 feet\", a purse); src/: every site read"]],
"components/ServerAddressButton.tsx#first": [["key",1,"the first shareable address"]],
"components/ServerAddressButton.tsx#partial": [["key",1,"UI keys, file names, glyphs and markdown"]],
Expand Down Expand Up @@ -2317,7 +2320,7 @@
"lib/dm/speech.ts#partial": [
[
"pattern",
15,
18,
"a fixed pattern over text that reads no record's name: its English words are scripts/text-comparisons.json's to classify"
],
[
Expand Down
63 changes: 50 additions & 13 deletions scripts/text-comparisons.json
Original file line number Diff line number Diff line change
Expand Up @@ -1065,15 +1065,16 @@
"lib/battlemap/generate.ts#str-list": [["key",1,"scene kinds (ambience bed ids)"]],
"lib/battlemap/hand-class.ts#str-eq": [["english-source",1,"the engine's own weapon name (\"Unarmed strike\")"]],
"lib/battlemap/hand-core.ts#re-word": [["english-source",1,"display: an English range shortened to \"ft\"; any other text is shown as written, nothing is inferred"]],
"lib/battlemap/hand-core.ts#str-eq": [["english-source",1,"engine's fixed placeholder name \"the enemy\" in can-act turn verdict"]],
"lib/battlemap/hand-core.ts#str-key": [["key",1,"ability ids"]],
"lib/battlemap/hand-core.ts#toLowerCase": [["key",1,"class id"],["key",1,"SRD feature names as once-per-turn keys, as pc-attack-spend.ts writes them (grantedRideMark)"]],
"lib/battlemap/hand-core.ts#toUpperCase": [["display",1,"capitalised range"]],
"lib/battlemap/hand-escape.ts#str-key": [["key",1,"ability ids"]],
"lib/battlemap/hand-intent.ts#str-list": [["key",5,"hand action ids and fields (fixed choice)"]],
"lib/battlemap/hand-options.ts#re-word": [["english-source",1,"the engine's own \"Maneuver:\" feature prefix (written by the builder)"]],
"lib/battlemap/hand-options.ts#toLowerCase": [["key",1,"resource variant from an SRD option name (a tool argument)"]],
"lib/battlemap/hand-play.ts#re-word": [["english-source",2,"the action line the hand itself writes (\"I attack X with ...\"), read back by the hand"]],
"lib/battlemap/hand-play.ts#str-eq": [["english-source",6,"the engine's own weapon name (\"Unarmed strike\"), spell resource label and SRD feature names"]],
"lib/battlemap/hand-play.ts#re-word": [["english-source",3,"the action line the hand itself writes (\"I attack X with ...\"), read back by the hand"]],
"lib/battlemap/hand-play.ts#str-eq": [["english-source",8,"the engine's own weapon name (\"Unarmed strike\"), \"Escape: \" prefix, \"@\" readied marker, spell resource label and SRD feature names"]],
"lib/battlemap/hand-play.ts#str-includes": [["english-source",2,"reference: SRD weapon properties (fixed vocabulary of the SRD rows and the workshop's property picker)"]],
"lib/battlemap/hand-play.ts#str-key": [["key",1,"bonus attack ids"]],
"lib/battlemap/hand-react.ts#re-word": [["english-source",1,"the engine's own \"Maneuver:\" feature prefix and reaction amounts"]],
Expand Down Expand Up @@ -2270,6 +2271,7 @@
"lib/harness/render.ts#re-word": [["key",1,"the server's own [System] tag that opens a turn instruction it appends (src/lib/dm/tool-text.ts): the same English tag at every table"]],
"lib/harness/run-dir-logic.ts#str-list": [["key",1,"run folder name prefixes and the sign-in file names Codex keeps (file names)"]],
"lib/harness/test-run.ts#toLowerCase": [["key",1,"a fixed test secret in a reply"]],
"lib/harness/test-run.ts#\\w": [["key",1,"template placeholder keys in passT ({key})"]],
"lib/harness/types.ts#str-list": [["key",1,"effort levels (fixed choice)"]],
"lib/help/index.ts#[a-z]": [["key",1,"anchor id from a help title"]],
"lib/help/index.ts#re-word": [["key",1,"a content-pack row's flag value (\"yes\")"]],
Expand Down Expand Up @@ -3925,13 +3927,6 @@
"device settings key lookup"
]
],
"app/campaigns/[campaignId]/MessageParts.tsx#[a-z]": [
[
"key",
1,
"display-only translation of DB-stored English system note templates (Chapter/Act/turn/combat) in translateSystemNote"
]
],
"lib/content/names.ts#\\b": [
[
"key",
Expand Down Expand Up @@ -3974,18 +3969,60 @@
"display-only tool grant category splitting in ClassChoices.tsx"
]
],
"app/campaigns/[campaignId]/CardReturnedNote.tsx#re-word": [
[
"display",
2,
"display-only translation of DB-stored English reach/range refusal lines in CardReturnedNote.tsx"
]
],
"app/campaigns/[campaignId]/MessageParts.tsx#\\b": [
[
"display",
2,
"display-only calendar year/day boundary in translateCalendarClause"
]
],
"app/campaigns/[campaignId]/MessageParts.tsx#re-word": [
[
"display",
9,
"display-only translation of DB-stored English system note templates in translateSystemNote"
61,
"display-only translation of DB-stored English system note and player action templates"
]
],
"app/campaigns/[campaignId]/MessageParts.tsx#re-affix": [
[
"display",
1,
"display-only plural suffix stripping for duration unit translation in MessageParts.tsx"
]
],
"app/campaigns/[campaignId]/MessageParts.tsx#str-eq": [
[
"display",
2,
"display-only translation of DB-stored English system note templates in translateSystemNote"
21,
"display-only translation of DB-stored English system note and player action templates"
]
],
"app/campaigns/[campaignId]/MessageParts.tsx#str-key": [
[
"display",
1,
"display-only condition word lookup in translateConditionWord"
]
],
"app/campaigns/[campaignId]/MessageParts.tsx#str-list": [
[
"display",
4,
"display-only calendar day/month/part/season word lists in translateCalendarClause"
]
],
"components/SceneTitle.tsx#re-word": [
[
"display",
3,
"display-only translation of Chapter/Act/End of Act title card labels in SceneTitle.tsx"
]
],
"app/characters/builder/steps/CallingStep.tsx#str-key": [
Expand Down
16 changes: 5 additions & 11 deletions src/app/admin/AdminStorageSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ function formatSize(bytes: number) {
return `${Math.max(bytes > 0 ? 1 : 0, Math.round(bytes / 1024))} KB`;
}

// "{value} live updates", keyed by noun so the table's language speaks:
// count(t, 3, "admin.storage.liveUpdate"). The key is a plural base
// (…_one/…_other), which translate() resolves at run time.
const count = (t: (key: string, vars?: Record<string, string | number>) => string, value: number, key: string) =>
t(key, { count: value });

export function AdminStorageSection() {
const t = useT();
const tp = useTp();
Expand Down Expand Up @@ -147,8 +141,8 @@ export function AdminStorageSection() {
) : null}
</li>
<li className="plate-row flex-wrap gap-x-4 gap-y-1 text-xs tabular-nums text-stone-500">
<span>{count(t, stats.eventRows, "admin.storage.liveUpdate")}</span>
<span>{count(t, stats.usageRows, "admin.storage.usageRow")}</span>
<span>{tp("{count} live update", "{count} live updates", { count: stats.eventRows })}</span>
<span>{tp("{count} usage row", "{count} usage rows", { count: stats.usageRows })}</span>
<span>{t("{size} of prompt traces", { size: formatSize(stats.traceBytes) })}</span>
</li>
<li className="plate-row flex-wrap gap-2 text-xs text-stone-500">
Expand All @@ -160,9 +154,9 @@ export function AdminStorageSection() {
<span key={report.at} className="live-in">
{t("Last tidy {date}: {events} cleared, {traces} dropped, {merged} merged, {space} returned.", {
date: new Date(report.at).toLocaleString(),
events: count(t, report.eventsRemoved, "admin.storage.update"),
traces: count(t, report.tracesCleared, "admin.storage.trace"),
merged: count(t, report.usageRowsMerged, "admin.storage.usageRow"),
events: tp("{count} update", "{count} updates", { count: report.eventsRemoved }),
traces: tp("{count} trace", "{count} traces", { count: report.tracesCleared }),
merged: tp("{count} usage row", "{count} usage rows", { count: report.usageRowsMerged }),
space: formatSize(report.bytesReclaimed),
})}
</span>
Expand Down
14 changes: 8 additions & 6 deletions src/app/api/admin/harness/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { rescueStrandedCampaigns } from "@/lib/image-backend-rescue";
import { forgetHarnessStatus, harnessConfig, probeAllHarnesses, probeHarness } from "@/lib/harness/status";
import { testHarness } from "@/lib/harness/test-run";
import { isHarnessId } from "@/lib/harness/types";
import { requestT } from "@/lib/request-locale";
import { isDeviceWorld } from "@/lib/server-env";

export const runtime = "nodejs";
Expand Down Expand Up @@ -52,9 +53,10 @@ export async function POST(request: Request) {
if (isErrorResponse(admin)) {
return admin;
}
const t = requestT(request);
const parsed = actionSchema.safeParse(await request.json().catch(() => ({})));
if (!parsed.success) {
return Response.json({ error: "Unknown action." }, { status: 400 });
return Response.json({ error: t("Unknown action.") }, { status: 400 });
}
const { action, id } = parsed.data;
if (action === "refresh") {
Expand All @@ -65,16 +67,16 @@ export async function POST(request: Request) {
if (action === "test") {
const config = harnessConfig();
if (id && id !== config.id) {
return Response.json({ error: "Save this program as the server's agent before testing it." }, { status: 409 });
return Response.json({ error: t("Save this program as the server's agent before testing it.") }, { status: 409 });
}
return Response.json(await testHarness(isHarnessId(config.id) ? config.id : undefined));
return Response.json(await testHarness(isHarnessId(config.id) ? config.id : undefined, t));
}
if (action === "adopt") {
// One step from a passing test to painting tables: on, the default for
// new campaigns, and the campaigns stranded on a backend that cannot
// paint moved onto it. Only after a real picture came back here.
if (!harnessConfig().imagesVerifiedAt) {
return Response.json({ error: "Paint a test picture first." }, { status: 409 });
return Response.json({ error: t("Paint a test picture first.") }, { status: 409 });
}
saveGlobalConfig({ harness: { images: "native" }, images: { defaultBackend: "harness" } });
forgetHarnessStatus();
Expand All @@ -83,9 +85,9 @@ export async function POST(request: Request) {
// A real picture, painted the way the tables paint one, before they are
// allowed to ask for it (src/lib/harness/picture-test.ts). Only a success
// here clears the option.
const result = await testHarnessPictures();
const result = await testHarnessPictures(t);
if (!result.image) {
return Response.json({ ...result, error: result.error ?? "The picture could not be made." }, { status: 502 });
return Response.json({ ...result, error: result.error ?? t("The picture could not be made.") }, { status: 502 });
}
saveGlobalConfig({ harness: { imagesVerifiedAt: new Date().toISOString() } });
forgetHarnessStatus();
Expand Down
8 changes: 5 additions & 3 deletions src/app/campaigns/[campaignId]/BoardChrome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,11 @@ function HealthWordChip({ word }: { word: HealthWord }) {

export function ConditionChip({ label, rounds, note }: { label: string; rounds?: number; note?: string }) {
const tp = useTp();
const locale = useLocale();
return (
<span className="fx-pop inline-flex max-w-full items-center gap-1 rounded-full border border-amber-900/60 bg-amber-950/30 py-px pl-px pr-1.5 text-[10px] text-amber-300">
<GameIcon icon={{ kind: "condition", key: conditionIconKey(label) }} size="size-4" />
<span className="capitalize">{label}</span>
<span className="capitalize">{contentName("conditions", label, locale)}</span>
{rounds ? ` ${tp("({count} rd)", "({count} rd)", { count: rounds })}` : ""}
{/* What the engine's metadata says: until whose turn, the save that
ends it, who laid it (src/lib/battlemap/condition-notes.ts). */}
Expand Down Expand Up @@ -381,6 +382,7 @@ function EdgeChips({ edge }: { edge: TargetEdge }) {
function ConditionRow({ id, label, rounds, note }: { id: string; label: string; rounds?: number; note?: string }) {
const t = useT();
const tp = useTp();
const locale = useLocale();
const rule = conditionRule(id, t);
return (
<li className="fx-pop flex items-start gap-2 text-left">
Expand All @@ -393,7 +395,7 @@ function ConditionRow({ id, label, rounds, note }: { id: string; label: string;
(globals.css). */}
<span className="min-w-0 flex-1">
<span className="block text-[11px] font-semibold text-[#ecd287]">
<span className="capitalize">{label}</span>
<span className="capitalize">{contentName("conditions", label, locale)}</span>
{rounds ? <span className="font-normal text-[rgba(244,224,166,0.8)]">{` ${tp("({count} rd)", "({count} rd)", { count: rounds })}`}</span> : null}
</span>
{rule ? <span className="block text-[10px] leading-snug text-[#d8d3ea]">{rule}</span> : null}
Expand Down Expand Up @@ -615,7 +617,7 @@ export function TokenPlate({
{rest.length ? (
<p className="text-[10px] leading-snug text-[#aeaac6]" data-plate-more>
<span className="font-semibold text-[#ecd287]">{t("+{count} more: ", { count: rest.length })}</span>
<span className="capitalize">{rest.map((condition) => condition.label).join(", ")}</span>
<span className="capitalize">{rest.map((condition) => contentName("conditions", condition.label, locale)).join(", ")}</span>
</p>
) : null}
</div>
Expand Down
26 changes: 25 additions & 1 deletion src/app/campaigns/[campaignId]/CardReturnedNote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ import type { ConcentrationSwap } from "@/lib/dm/concentration-confirm-logic";
// the story telling it as done. Nothing was spent, so the Hand deals the
// card again; its player can also play it again from here in one press,
// with the same sentence and the same choices.
type T = ReturnType<typeof useT>;

function translateCardReturnedReason(t: T, raw: string): string {
let m = /^(.+?) is (\d+) ft from (.+?), out of melee reach \((\d+) ft\)\.(.*)$/.exec(raw);
if (m) {
return t("{attacker} is {distance} ft from {target}, out of melee reach ({reach} ft).", {
attacker: m[1],
distance: m[2],
target: m[3],
reach: m[4],
});
}
m = /^(.+?) is (\d+) ft from (.+?), beyond this attack's (\d+) ft maximum range\.(.*)$/.exec(raw);
if (m) {
return t("{attacker} is {distance} ft from {target}, beyond this attack's {range} ft maximum range.", {
attacker: m[1],
distance: m[2],
target: m[3],
range: m[4],
});
}
return raw;
}

export function CardReturnedNote({ message, mine, name }: { message: CampaignMessage; mine: boolean; name: string }) {
const [state, setState] = useState<"idle" | "sending" | "sent">("idle");
const [error, setError] = useState("");
Expand Down Expand Up @@ -67,7 +91,7 @@ export function CardReturnedNote({ message, mine, name }: { message: CampaignMes
<Undo2 className="mt-0.5 size-3.5 shrink-0" aria-hidden />
<span>
{mine ? t("This did not happen. It is back in your hand.") : t("This did not happen. It went back to {name}'s hand.", { name })}
{message.cardReturned ? <span className="block text-stone-400">{message.cardReturned}</span> : null}
{message.cardReturned ? <span className="block text-stone-400">{translateCardReturnedReason(t, message.cardReturned)}</span> : null}
</span>
</p>
{mine && message.intent ? (
Expand Down
Loading
Loading