Skip to content

Build your personal knowledge base with Trilium Notes

chore(scripts): improve messages for translation check script

Elian Doran1917adb3220f
diff --git a/scripts/translation/check-translation-coverage.ts b/scripts/translation/check-translation-coverage.ts
index 57ae4a57e4..0e01040604 100644
--- a/scripts/translation/check-translation-coverage.ts
+++ b/scripts/translation/check-translation-coverage.ts
@@ -2,20 +2,21 @@ import { LOCALES } from "../../packages/commons/src/lib/i18n";
import { getLanguageStats } from "./utils";
async function main() {
- const languageStats = await getLanguageStats("client");
- const localeIdsWithCoverage = languageStats.results
+ const project = "client";
+ const languageStats = await getLanguageStats(project);
+ const localesWithCoverage = languageStats.results
.filter(language => language.translated_percent > 50)
- .map(language => language.language_code);
- for (const localeId of localeIdsWithCoverage) {
+ for (const localeData of localesWithCoverage) {
+ const { language_code: localeId, translated_percent: percentage, language } = localeData;
const locale = LOCALES.find(l => l.id === localeId);
if (!locale) {
- console.error(`Locale not found for id: ${localeId}`);
+ console.error(`❌ Language ${language.name} (${localeId}) has a coverage of ${percentage}% in '${project}', but it is not supported by the application.`);
process.exit(1);
}
}
- console.log("Translation coverage check passed.");
+ console.log("✅ Translation coverage check passed.");
}
main();