fix: translate settlement runway chart labels

This commit is contained in:
2569718930@qq.com
2026-05-28 22:44:36 +08:00
parent c2fe8caddf
commit 3cc2251b9b
2 changed files with 36 additions and 3 deletions
@@ -342,6 +342,33 @@ export function runTests() {
assert(!highlighted.dashed, `${city} settlement runway should be solid`);
const auxiliary = seriesByKey(chart.series, "runway_99_00") as any;
assert(auxiliary?.dashed === true, `${city} auxiliary runway should be dashed`);
const englishChart = __buildTemperatureChartDataForTest(
{
city,
local_date: "2026-05-25",
local_time: "10:00",
tz_offset_seconds: 8 * 60 * 60,
runway_plate_history: {
[settlementRwy]: [
{ time: "00:05", temp: 25.1 },
{ time: "00:35", temp: 25.3 },
],
},
} as any,
{ localTime: "10:00", times: ["00:00", "00:30"], temps: [25, 26] } as any,
"1D",
true,
);
const englishSettlement = seriesByKey(englishChart.series, runwayKey(settlementRwy)) as any;
assert(
englishSettlement?.label.includes("Settlement Runway"),
`${city} English settlement runway label should be translated`,
);
assert(
!englishSettlement?.label.includes("结算跑道"),
`${city} English settlement runway label should not leak Chinese`,
);
});
const shenzhen = __buildTemperatureChartDataForTest(