π OpenHands: AI-Driven Development
fix i18n script (#7783)
Robert Brennan159f79f9d8a2
diff --git a/frontend/scripts/check-unlocalized-strings.cjs b/frontend/scripts/check-unlocalized-strings.cjsindex c8e2575025..16342fb96b 100755--- a/frontend/scripts/check-unlocalized-strings.cjs+++ b/frontend/scripts/check-unlocalized-strings.cjs@@ -47,6 +47,7 @@ const SCAN_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];// Attributes that typically don't contain user-facing textconst NON_TEXT_ATTRIBUTES = ["className",+ "i18nKey","testId","id","name",@@ -685,23 +686,23 @@ function scanDirectoryForUnlocalizedStrings(dirPath) {try {const srcPath = path.resolve(__dirname, '../src');console.log('Checking for unlocalized strings in frontend code...');-+// Get unlocalized strings using the AST scannerconst results = scanDirectoryForUnlocalizedStrings(srcPath);-+// If we found any unlocalized strings, format them for output and exit with errorif (results.size > 0) {const formattedResults = Array.from(results.entries()).map(([file, strings]) => `\n${file}:\n ${strings.join('\n ')}`).join('\n');-+console.error(`Error: Found unlocalized strings in the following files:${formattedResults}`);process.exit(1);}-+console.log('β No unlocalized strings found in frontend code.');process.exit(0);} catch (error) {console.error('Error running unlocalized strings check:', error);process.exit(1);-}\ No newline at end of file+}