mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
i18n(de): apply review round 1
- Meaning fixes: playback connects to the broadcaster when it starts, browser
keys are restricted at the provider, clearing data layers switches them off
(ausschalten, not löschen), cockpit inputs are Quellen, Electronic is
Elektronische Musik, AIS types name vessels (SEGLER, LOTSENBOOT,
SANITÄTSDIENST, SCHNELLSCHIFF), contiguous US excludes Alaska/Hawaii,
wind and weather readings are model values, nearest frames are nearest in
time, cloud imagery and the brightness filter say what they are.
- NHC/CPHC advisories are Lageberichte, not Warnungen; cyclone strings use
Wirbelsturm throughout. Glossary updated.
- Grammar: " oder " keeps its space as a join separator, "{x} konnte nicht
sauber beendet werden", Then: no longer doubles Dann, scene save reasons
continue the sentence in lower case, neutral "Warten auf".
- Spacing between numbers and units in the remaining nine readouts.
- Reroute tooltip: German mode nouns keep their capital (Auto, Fahrrad).
- Built-in Nepal shot titles localize in every language: the legacy scene
upgrade rebuilds its base shots without sourcePackId, so the pack's own
shots in the scene now vouch for them.
- Layout: the layer status column no longer shrinks under a wide chip, and
a mixed-case compound (ALPR-Kameras) may break at its hyphen; only capital
codes (ADS-B, RTL-SDR) stay unbroken. WIRD AKTIVIERT overlapped the name.
The Bhote step meta line may take a third line.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0d28150e22
commit
1eb9e06c49
10 files changed
+232
-134
No files matched your search
+22
-1
@@ -1069,13 +1069,34 @@ export function displaySceneTitle(scene) {
|
||||
export function displayShotTitle(title, shot = undefined, scene = undefined) {
|
||||
const text = typeof title === 'string' ? title : '';
|
||||
const fromRecipe = shot
|
||||
? Boolean(shot.sourcePackId) || recipeDeclaresShotTitle(scene?.id, text)
|
||||
? Boolean(shot.sourcePackId) ||
|
||||
recipeDeclaresShotTitle(scene?.id, text) ||
|
||||
shotPackDeclaresBaseTitle(scene, text)
|
||||
: true;
|
||||
if (fromRecipe && BUILTIN_SHOT_TITLES.has(text)) return t(text);
|
||||
const numbered = /^Shot ([1-9]\d*)$/.exec(text);
|
||||
return numbered ? t('Shot {n}', { n: numbered[1] }) : text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a shot pack that upgraded this scene declares the title for one of
|
||||
* its legacy base shots. The upgrade rebuilds those shots without a
|
||||
* sourcePackId (see SceneDirector._bootstrapLegacyShotPacks), so the pack's
|
||||
* own shots in the scene vouch for them.
|
||||
* @param {{shots?: Array<{sourcePackId?: string}>}} [scene]
|
||||
* @param {string} title
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function shotPackDeclaresBaseTitle(scene, title) {
|
||||
const shots = Array.isArray(scene?.shots) ? scene.shots : [];
|
||||
return SCENE_APPEND_RECIPES.some(
|
||||
(pack) =>
|
||||
pack.legacySceneBootstrap?.cameraPath?.some(
|
||||
(keyframe) => keyframe?.title === title,
|
||||
) && shots.some((item) => item?.sourcePackId === pack.id),
|
||||
);
|
||||
}
|
||||
|
||||
/** Whether the built-in recipe behind a scene declares a shot with this title. */
|
||||
function recipeDeclaresShotTitle(sceneId, title) {
|
||||
const recipe = sceneId ? getSceneRecipeById(sceneId) : null;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
SCENE_APPEND_RECIPES,
|
||||
SCENE_RECIPES,
|
||||
displaySceneTitle,
|
||||
displayShotTitle,
|
||||
@@ -141,3 +142,24 @@ test('the scene context of a shot carries its display title by provenance', asyn
|
||||
title,
|
||||
);
|
||||
});
|
||||
|
||||
test('the base shots of a scene the Nepal pack upgraded localize', () => {
|
||||
const pack = SCENE_APPEND_RECIPES.find(
|
||||
(recipe) => recipe.legacySceneBootstrap?.cameraPath?.length,
|
||||
);
|
||||
if (!pack) return;
|
||||
setLocale('de');
|
||||
const title = pack.legacySceneBootstrap.cameraPath[0].title;
|
||||
const base = { id: 'shot-base', title };
|
||||
const upgraded = {
|
||||
id: 'scene-upgraded',
|
||||
shots: [base, { id: 'shot-pack', title: 'x', sourcePackId: pack.id }],
|
||||
};
|
||||
assert.equal(displayShotTitle(title, base, upgraded), displayShotTitle(title));
|
||||
assert.notEqual(displayShotTitle(title), title);
|
||||
// The same title in a scene no pack touched stays as typed.
|
||||
assert.equal(
|
||||
displayShotTitle(title, base, { id: 'scene-user', shots: [base] }),
|
||||
title,
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user