Skip to content

Commit 143ef31

Browse files
committed
fix(ui-scripts): the en-drift gate's en-first assertion runs inside a declaration, so importing the gate runs nothing
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyWSiXh6B2sMVHfXYC
1 parent f7e9df2 commit 143ef31

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎ui/scripts/check-i18n-en-drift.mjs‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,14 @@ const scriptDir = dirname(fileURLToPath(import.meta.url));
190190
* that first sees it; a pack file missing at HEAD then fails loudly in
191191
* {@link readPacks}.
192192
*/
193-
export const LOCALES = Object.freeze([...PLATFORM_LOCALE_TAGS]);
194-
if (LOCALES[0] !== 'en') {
195-
throw new Error(`the platform locale table no longer opens with en (got ${LOCALES[0]}); this gate compares against en`);
193+
export const LOCALES = Object.freeze(enFirstTableTags(PLATFORM_LOCALE_TAGS));
194+
195+
/** The table's tags, refused unless `en` opens them: this gate compares against `en`. */
196+
function enFirstTableTags(tags) {
197+
if (tags[0] !== 'en') {
198+
throw new Error(`the platform locale table no longer opens with en (got ${tags[0]}); this gate compares against en`);
199+
}
200+
return [...tags];
196201
}
197202

198203
/** The packs that must follow `en`: every other table tag. */

0 commit comments

Comments
 (0)