Skip to content

Commit ff3c5a3

Browse files
rbrenshabbir-shakudo
authored andcommitted
fix i18n script (All-Hands-AI#7783)
1 parent 95ebd91 commit ff3c5a3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

frontend/scripts/check-unlocalized-strings.cjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const SCAN_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
4747
// Attributes that typically don't contain user-facing text
4848
const NON_TEXT_ATTRIBUTES = [
4949
"className",
50+
"i18nKey",
5051
"testId",
5152
"id",
5253
"name",
@@ -685,23 +686,23 @@ function scanDirectoryForUnlocalizedStrings(dirPath) {
685686
try {
686687
const srcPath = path.resolve(__dirname, '../src');
687688
console.log('Checking for unlocalized strings in frontend code...');
688-
689+
689690
// Get unlocalized strings using the AST scanner
690691
const results = scanDirectoryForUnlocalizedStrings(srcPath);
691-
692+
692693
// If we found any unlocalized strings, format them for output and exit with error
693694
if (results.size > 0) {
694695
const formattedResults = Array.from(results.entries())
695696
.map(([file, strings]) => `\n${file}:\n ${strings.join('\n ')}`)
696697
.join('\n');
697-
698+
698699
console.error(`Error: Found unlocalized strings in the following files:${formattedResults}`);
699700
process.exit(1);
700701
}
701-
702+
702703
console.log('✅ No unlocalized strings found in frontend code.');
703704
process.exit(0);
704705
} catch (error) {
705706
console.error('Error running unlocalized strings check:', error);
706707
process.exit(1);
707-
}
708+
}

0 commit comments

Comments
 (0)