Files
Quer3qandClaude Opus 5.5 077d74c2b0 UI in 11 languages, right-to-left Arabic, localized PS5 notices, tests trimmed
- UI languages: English, Russian, Simplified Chinese, German, Spanish, French,
  Japanese, Brazilian Portuguese, Italian, Korean and Arabic. Messages in
  app/src/locales/<lang>.tsx (en.tsx is the source and the Messages type), each
  its own chunk; i18n.ts loads, detects and switches; the choice is kept in
  localStorage. About's language dropdown sits in the card header.
- Arabic is right-to-left: logical CSS properties plus [dir=rtl] overrides,
  paths and runtime values isolated, Latin digits.
- Game titles from param.json's localizedParameters (title_names).
- The PS5 server's notices follow the console language (notice.rs); the start
  notice is "Dump Forge is launched"; the stopped page says to relaunch the app.
- UI copy says "game" instead of "dump" and "icon" instead of "tile".
- macOS window no longer private, so the language choice persists.
- Tests cut to the critical ~half: crates 446 -> 241, vendor 270 -> 144
  (vendor/patches/0027-trim-tests.patch), node check assertions 217 -> 111.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 18:29:25 +03:00

40 lines
1.9 KiB
JavaScript

// Checks src/paths.ts with a plain `node scripts/check-paths.mjs` (type stripping): the
// desktop rules per viewer OS, and the http build's server paths (`/` only) on a Windows viewer.
import assert from "node:assert/strict";
async function load(userAgent, tag) {
Object.defineProperty(globalThis, "navigator", { value: { userAgent }, configurable: true });
return import(`../src/paths.ts?${tag}`);
}
// macOS/Linux app: `\` is a name character.
const mac = await load("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)", "mac");
assert.equal(mac.joinPath("/Volumes/odd\\", "x"), "/Volumes/odd\\/x");
assert.equal(mac.dirname("/game"), "/");
assert.equal(mac.basename("/a/b\\c"), "b\\c");
// Windows app: both separators, joins with `\`.
const win = await load("Mozilla/5.0 (Windows NT 10.0; Win64; x64)", "win");
assert.equal(win.joinPath("C:\\Games", "Game.ffpkg"), "C:\\Games\\Game.ffpkg");
assert.equal(win.dirname("C:\\game"), "C:\\");
assert.equal(win.basename("C:\\Games\\PPSA01234\\"), "PPSA01234");
// http build on a Windows viewer, PS5 server (separator "/"): `/` paths, `\` a name character.
win.setServerSeparator("/");
assert.equal(win.joinPath("/mnt/usb0/", "Game.exfat"), "/mnt/usb0/Game.exfat");
assert.equal(win.joinPath("/data/odd\\", "x"), "/data/odd\\/x");
assert.equal(win.dirname("/data"), "/");
assert.equal(win.dirname("/data/a\\b"), "/data");
assert.equal(win.basename("/data/a\\b/"), "a\\b");
// http build on a macOS viewer, Windows host server (separator "\\"): the Windows rules.
mac.setServerSeparator("\\");
assert.equal(mac.joinPath("C:\\Games", "Game.ffpkg"), "C:\\Games\\Game.ffpkg");
assert.equal(mac.dirname("C:\\game"), "C:\\");
// And back to "/" (a later session saying so).
mac.setServerSeparator("/");
assert.equal(mac.dirname("/data/a\\b"), "/data");
console.log("paths.ts: ok (macOS, Windows, http: PS5 server on a Windows viewer, Windows-host server on a macOS viewer)");