i18n: fix the LGTM review findings and tidy the branch texts

- i18n scanner: lastError sink, no false sinks on defaults and ternaries
- shared src/i18n/marker.js for modules that only mark strings
- wind field messages move to wind/fields.js; CITY_POIS imports from cityPois.js
- drop review IDs, change history and stale references from comments and docs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Opus 5.5 committed 2026-10-16 21:00:28 +04:00
1 parent 0ed05568f7
commit 20f4cf3763
178 files changed
+918 -948

No files matched your search

+2 -9
View File
@@ -65,12 +65,6 @@ import {
} from '../director/document.js';
import { sceneSaveFailureReason } from './sceneSaveError.js';
// Built-in recipe DISPLAY names. Recipe ids, the URL 'scene' param, stored
// project titles, and voice-matching titles all stay English (keep-English
// boundary + persisted data); only the presentation of an UNRENAMED built-in
// localizes, so an operator's renamed scene is never masked by the catalog.
// Recipe and built-in shot titles are marked with msg() in recipes.js.
/** @constant {string} localStorage key for the serialized project */
const STORAGE_KEY = 'godsEyeView.sceneProject.v2';
const STORAGE_CHECKPOINT_KEY = 'godsEyeView.sceneProject.checkpoint.v1';
@@ -413,9 +407,8 @@ export class SceneDirector {
this._controls = new SceneControls({
subscribe: (listener) => this.subscribe(listener),
read: () => ({
// Scene titles surface in the panel through SceneControls; built-in
// recipe and shot titles display their localized name until renamed
// by the user. Shots keep the stored title for editing and matching.
// The panel shows display titles; shots keep the stored title for
// editing and matching.
scenes: this._project.scenes.map((scene) => ({
...scene,
title: displaySceneTitle(scene),
+12 -12
View File
@@ -7,7 +7,7 @@ import { SOURCE_PATH_BEAT_IDS } from '../data/bhoteKoshiShotPaths.js';
const ADDITIONAL_SHOTS = [
{
id: 'second-landslide',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Second landslide',
lat: 28.399234,
lon: 85.535806,
@@ -18,7 +18,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'dhunche',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Dhunche',
lat: 28.161431,
lon: 85.324278,
@@ -29,7 +29,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'mailung-upper-trishuli',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Mailung / Upper Trishuli bridge',
lat: 28.140642,
lon: 85.265996,
@@ -40,7 +40,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'mailung-bazzar',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Mailung Bazzar, Dandaguan',
lat: 28.126526,
lon: 85.248027,
@@ -51,7 +51,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'dandagaun',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Dandagaun, Rasuwa',
lat: 28.124424,
lon: 85.245154,
@@ -62,7 +62,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'dandagaun-viewpoint',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Dandagaun viewpoint restaurant',
lat: 28.086663,
lon: 85.229914,
@@ -73,7 +73,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'betrawati-bazaar',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Betrawati Bazaar',
lat: 28.029827,
lon: 85.227694,
@@ -84,7 +84,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'bhainse',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhainse',
lat: 28.023087,
lon: 85.229449,
@@ -95,7 +95,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'devighat-taadi-khola-bridge',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Devighat / Taadi Khola Bridge',
lat: 27.921132,
lon: 85.177113,
@@ -106,7 +106,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'charaudi',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Charaudi',
lat: 27.865095,
lon: 84.838424,
@@ -117,7 +117,7 @@ const ADDITIONAL_SHOTS = [
},
{
id: 'final-view',
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Final view',
lat: 28.0834,
lon: 85.206,
@@ -351,7 +351,7 @@ export function expandNepalEvidencePack(base) {
shotPatches: [
...(base.shotPatches || []),
{
// i18n-ignore: shot title (mostly a place name), matched by title on upgrade
// i18n-ignore: stored shot title, matched verbatim
title: 'Final view',
layers: finalView.layers,
},
+30 -31
View File
@@ -27,7 +27,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
fromShotTitles: ['Shot 1', 'Shot 2', 'Shot 3'],
cameraPath: [
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Global Incident Context',
lat: 27.5962,
lon: 78.5718,
@@ -45,7 +45,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Nepal-Focused Globe Rotation',
lat: 28.7248,
lon: 81.3226,
@@ -63,7 +63,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Regional Approach',
lat: 27.0354,
lon: 84.6287,
@@ -81,7 +81,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Nearby Cities',
lat: 27.891,
lon: 85.428,
@@ -99,7 +99,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Incident Corridor',
lat: 28.0529,
lon: 85.2189,
@@ -117,7 +117,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Flood Path',
lat: 28.1691,
lon: 85.352,
@@ -135,7 +135,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Corridor Overview',
lat: 27.8986,
lon: 84.8723,
@@ -153,7 +153,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Upper Valley',
lat: 28.4187,
lon: 85.4341,
@@ -230,7 +230,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
shotPatches: [
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Global Incident Context',
visual: { mapStack: 'photoreal' },
layers: {
@@ -246,7 +246,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Nepal-Focused Globe Rotation',
visual: { mapStack: 'photoreal' },
layers: {
@@ -262,7 +262,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Regional Approach',
visual: { mapStack: 'photoreal' },
layers: {
@@ -278,7 +278,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Nearby Cities',
visual: { mapStack: 'photoreal' },
layers: {
@@ -294,7 +294,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Incident Corridor',
camera: {
lat: 28.0529,
@@ -319,7 +319,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Flood Path',
visual: { mapStack: 'photoreal' },
layers: {
@@ -335,7 +335,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Corridor Overview',
visual: { mapStack: 'photoreal' },
layers: {
@@ -351,7 +351,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bhote Koshi Upper Valley',
holdSec: 8,
visual: { mapStack: 'photoreal' },
@@ -374,7 +374,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Upper Valley Collapse',
camera: {
lat: 28.417,
@@ -398,29 +398,29 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Nepal-China Border Gate',
visual: { mapStack: 'photoreal' },
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Timure Evidence Cluster',
visual: { mapStack: 'photoreal' },
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Syabru Besi Passage',
visual: { mapStack: 'photoreal' },
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bidur / Trishuli Consequence',
visual: { mapStack: 'photoreal' },
},
],
cameraPath: [
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Upper Valley Collapse',
lat: 28.417,
lon: 85.3937,
@@ -444,7 +444,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Debris-Dammed Lake',
lat: 28.392914,
lon: 85.570921,
@@ -468,7 +468,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Nepal-China Border Gate',
mapStack: 'photoreal',
lat: 28.316789,
@@ -499,7 +499,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Timure Evidence Cluster',
mapStack: 'photoreal',
lat: 28.285968,
@@ -528,7 +528,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Syabru Besi Passage',
mapStack: 'photoreal',
lat: 28.210306,
@@ -557,7 +557,7 @@ const BHOTE_KOSHI_NEPAL_BASE_RECIPE = Object.freeze({
},
},
{
// i18n-ignore: shot title, matched by title when the recipe upgrades a saved project
// i18n-ignore: stored shot title, matched verbatim
title: 'Bidur / Trishuli Consequence',
mapStack: 'photoreal',
lat: 27.981737,
@@ -1057,10 +1057,9 @@ export function displaySceneTitle(scene) {
* Display title for a shot: built-in titles and the numbered "Shot N"
* fallback localize; any other title shows as stored.
*
* With the shot itself, a built-in title localizes only when the shot came
* from a recipe (`sourcePackId`), so an operator-typed title that happens to
* match a built-in one is never masked by the catalog. Without it, provenance
* is unknown and the title alone decides, as before.
* With `shot`, a built-in title localizes only for a recipe shot
* (`sourcePackId`), so a typed title that matches a built-in one stays as
* typed. Without `shot`, the title alone decides.
* @param {string} title
* @param {{sourcePackId?: string}} [shot]
* @param {{id?: string}} [scene] The shot's scene, for projects saved before
+4 -10
View File
@@ -1,14 +1,8 @@
/**
* The reason shown in «Scene not saved — {reason}» when the project fails its
* own validation on save.
*
* A SceneDocumentError names a JSON path and an English check
* («$.scenes[6].title: expected nonempty text, at most 4096 characters») —
* right for the console and for import diagnostics, meaningless in a toast.
* The failures an author can cause from the panel get a plain sentence with
* 1-based scene and shot numbers. Anything else keeps the technical text in
* English and gets a general sentence in a translation; director.js logs the
* error either way.
* The reason for «Scene not saved — {reason}» when the project fails
* validation. The validator's text («$.scenes[6].title: expected …») is for
* the console: known failures get a sentence with 1-based numbers, others a
* general one (English keeps the raw text). director.js logs the full error.
*/
import { formatNumber, getLocale, t } from '../i18n/index.js';
+2 -3
View File
@@ -1,6 +1,5 @@
// Proposal 8: «Scene not saved — {reason}» showed the validator's JSON path
// and English check. Known failures read as a sentence; the rest get a
// general reason (the technical text is logged by director.js).
// «Scene not saved — {reason}» never shows the validator's JSON path: known
// failures read as a sentence, the rest get a general reason.
import { test } from 'node:test';
import assert from 'node:assert/strict';
+1 -1
View File
@@ -58,7 +58,7 @@ test('a built-in shot title localizes only for a recipe-sourced shot', () => {
userScene,
);
assert.notEqual(fromRecipe, title);
// Without provenance the title alone decides, as before.
// Without provenance the title alone decides.
assert.equal(displayShotTitle(title), fromRecipe);
// A project saved before shots recorded their source pack: the scene's
// recipe still vouches for a title its keyframes declare (only when such a