fix(i18n): guard language renders without global binding

This commit is contained in:
Codex committed 2026-09-28 10:21:39 +09:00
1 parent 0cd7211ca2
commit 8cf3a35b6f
7 files changed
+14 -12

No files matched your search

+3 -1
View File
@@ -41,7 +41,9 @@ assert.match(source, /id==='today'\)window\.today\(c\)/);
assert.match(assets.i18nJs, /window\.setLanguage = setLanguage/);
assert.match(assets.i18nRenderersJs, /window\.renderAll\(\)/);
assert.match(assets.indexHtml, /setTimeout\(\(\)=>window\.applyLanguage\?\.\(\),0\)/, "missing locale UI code cannot abort desktop initialization");
assert.ok(assets.indexHtml.indexOf('src="i18n-renderers.js?v=1.5.5"') < assets.indexHtml.lastIndexOf("window.init()"), "locale renderers load before desktop initialization");
assert.doesNotMatch(assets.indexHtml, /setTimeout\(applyLanguage\s*,/);
assert.doesNotMatch(assets.addonsJs, /(?<![\w.])applyLanguage\s*\(/, "add-on actions must not call a missing global locale function");
assert.ok(assets.indexHtml.indexOf('src="i18n-renderers.js?v=1.5.6"') < assets.indexHtml.lastIndexOf("window.init()"), "locale renderers load before desktop initialization");
for (const script of [assets.i18nJs, assets.tasksJs, assets.calendarJs, assets.i18nRenderersJs, assets.addonsJs]) new vm.Script(script);
assert.doesNotMatch(source, /Version 0\.1|Schema v1/);
const makeStorage = initial => {