Skip to content

Commit

Permalink
added "Check localizations" action
Browse files Browse the repository at this point in the history
  • Loading branch information
0neGal committed Jul 23, 2024
1 parent 877d0e5 commit 5ddec75
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/localizations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Localizations
on:
push:
pull_request:
types: [opened, reopened]

jobs:
check-localizations:
name: "Check localizations"
runs-on: "ubuntu-latest"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node environment
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Check localizations
run: npm run langs:check
12 changes: 10 additions & 2 deletions scripts/langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,18 @@ let check = (logging = true) => {

// run `check()` if `--check()` is set
if (args["check"]) {
let problems = check();
let has_problems = false;

// check localizations, and set `has_problems` depending on whether
// any localization files have problems
Object.values(check()).forEach((item) => {
if (item.length) {
has_problems = true;
}
});

// exit with the correct exit code
if (problems.length) {
if (has_problems) {
process.exit(1);
} else {
process.exit();
Expand Down

0 comments on commit 5ddec75

Please sign in to comment.