فهرست منبع

Add find-missing-translations as a CI check

Matt Rubens 9 ماه پیش
والد
کامیت
61339ee855
2فایلهای تغییر یافته به همراه17 افزوده شده و 0 حذف شده
  1. 15 0
      .github/workflows/code-qa.yml
  2. 2 0
      scripts/find-missing-translations.js

+ 15 - 0
.github/workflows/code-qa.yml

@@ -28,6 +28,21 @@ jobs:
       - name: Lint
       - name: Lint
         run: npm run lint
         run: npm run lint
 
 
+  check-translations:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+      - name: Setup Node.js
+        uses: actions/setup-node@v4
+        with:
+          node-version: '18'
+          cache: 'npm'
+      - name: Install dependencies
+        run: npm run install:all
+      - name: Verify all translations are complete
+        run: node scripts/find-missing-translations.js
+
   knip:
   knip:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:

+ 2 - 0
scripts/find-missing-translations.js

@@ -206,6 +206,8 @@ function findMissingTranslations() {
 			console.log("1. Add the missing keys to the corresponding locale files")
 			console.log("1. Add the missing keys to the corresponding locale files")
 			console.log("2. Translate the English values to the appropriate language")
 			console.log("2. Translate the English values to the appropriate language")
 			console.log("3. Run this script again to verify all translations are complete")
 			console.log("3. Run this script again to verify all translations are complete")
+			// Exit with error code to fail CI checks
+			process.exit(1)
 		}
 		}
 	} catch (error) {
 	} catch (error) {
 		console.error("Error:", error.message)
 		console.error("Error:", error.message)