From 71ec874986c9a75ccc2292060388c67c3b62df03 Mon Sep 17 00:00:00 2001 From: Mama Naomi Date: Thu, 22 Feb 2024 01:01:01 -0800 Subject: [PATCH] fix(tools): update i18n sync (#53821) --- tools/scripts/sync-i18n.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/scripts/sync-i18n.ts b/tools/scripts/sync-i18n.ts index 83e1ec86a1a..7e5a3a3ee65 100644 --- a/tools/scripts/sync-i18n.ts +++ b/tools/scripts/sync-i18n.ts @@ -41,13 +41,19 @@ const syncChallenges = async () => { ); } const englishContent = await readFile(path, 'utf-8'); + if (path.endsWith('LICENSE.txt')) { + await writeFile(targetPath, englishContent, 'utf-8'); + return; + } const langContent = await readFile(targetPath, 'utf-8'); const engLines = englishContent.split('\n'); const engId = engLines.find(l => l.startsWith('id')); const engSlug = engLines.find(l => l.startsWith('dashedName')); const langLines = langContent.split('\n'); const langId = langLines.find(l => l.startsWith('id')); - const langSlug = langLines.find(l => l.startsWith('dashedName')); + const langSlug = langLines.find( + l => l.startsWith('dashedName') || l.startsWith('certification:') + ); if (!langSlug) { throw new Error( `Missing dashedName for ${targetPath}. Please add it so that it matches the English version.`