Skip to content

Commit 60b4835

Browse files
committed
Merge branch 'feat-1.8.0-release-prep' into chore-sync-1.8.0
2 parents 852f06c + 610a359 commit 60b4835

7,599 files changed

Lines changed: 356051 additions & 64997 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ _APP_OPTIONS_ROUTER_PROTECTION=disabled
2121
_APP_OPTIONS_FORCE_HTTPS=disabled
2222
_APP_OPTIONS_ROUTER_FORCE_HTTPS=disabled
2323
_APP_OPENSSL_KEY_V1=your-secret-key
24+
_APP_DNS=8.8.8.8
2425
_APP_DOMAIN=traefik
2526
_APP_CONSOLE_DOMAIN=localhost
2627
_APP_DOMAIN_FUNCTIONS=functions.localhost
2728
_APP_DOMAIN_SITES=sites.localhost
2829
_APP_DOMAIN_TARGET_CNAME=test.localhost
2930
_APP_DOMAIN_TARGET_A=127.0.0.1
3031
_APP_DOMAIN_TARGET_AAAA=::1
32+
_APP_DOMAIN_TARGET_CAA=digicert.com
3133
_APP_RULES_FORMAT=md5
3234
_APP_REDIS_HOST=redis
3335
_APP_REDIS_PORT=6379

.github/labeler.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/auto-label-issue.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/static-analysis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ jobs:
1313
- name: Run CodeQL
1414
run: |
1515
docker run --rm -v $PWD:/app composer:2.6 sh -c \
16-
"composer install --profile --ignore-platform-reqs && composer check"
16+
"composer install --profile --ignore-platform-reqs && composer check"
17+
18+
- name: Run Locale check
19+
run: |
20+
docker run --rm -v $PWD:/app node:24-alpine sh -c \
21+
"cd /app/.github/workflows/static-analysis/locale && node index.js"
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* Look into all local files, and collect unique keys.
3+
* Ensure fallback locale (English) has translation for all keys.
4+
* If configured as `const strict = true`, all locales will be checked to include all keys.
5+
*/
6+
7+
import { readdir, readFile } from "fs/promises";
8+
import { join, dirname } from "path";
9+
import { fileURLToPath } from "url";
10+
11+
const config = {
12+
strict: false,
13+
fallbackLocale: "en.json",
14+
};
15+
16+
(async () => {
17+
try {
18+
// Prepare current directory equivalent in ES modules
19+
const __filename = fileURLToPath(import.meta.url);
20+
const __dirname = dirname(__filename);
21+
22+
const translationsPath = join(
23+
__dirname,
24+
"../../../../app/config/locale/translations",
25+
);
26+
27+
const files = (await readdir(translationsPath)).filter((file) =>
28+
file.endsWith(".json"),
29+
);
30+
31+
if (files.length === 0) {
32+
console.error("No translation files found in ", translationsPath);
33+
process.exit(1);
34+
}
35+
36+
// Check if fallback locale exists
37+
if (!files.includes(config.fallbackLocale)) {
38+
console.error(`Fallback locale file ${config.fallbackLocale} not found`);
39+
process.exit(1);
40+
}
41+
42+
console.log(
43+
`Found ${files.length} translation files in ${translationsPath}`,
44+
);
45+
46+
// Collect all unique keys from all translation files
47+
const allKeys = new Set();
48+
49+
for (const file of files) {
50+
const filePath = join(translationsPath, file);
51+
const content = await readFile(filePath, "utf8");
52+
const translations = JSON.parse(content);
53+
54+
// Add all keys from this file
55+
Object.keys(translations).forEach((key) => allKeys.add(key));
56+
}
57+
58+
console.log(`Total unique keys found across all locales: ${allKeys.size}`);
59+
60+
const localesToCheck = [];
61+
if (config.strict) {
62+
localesToCheck.push(...files);
63+
} else {
64+
localesToCheck.push(config.fallbackLocale);
65+
}
66+
67+
let errorsCount = 0;
68+
let missingLocaleCount = 0;
69+
70+
for (const localeToCheck of localesToCheck) {
71+
// Read locale
72+
const path = join(translationsPath, localeToCheck);
73+
const content = await readFile(path, "utf8");
74+
const translations = JSON.parse(content);
75+
76+
// Check for missing keys in the locale
77+
const keys = new Set(Object.keys(translations));
78+
console.log(`Keys in locale (${localeToCheck}): ${keys.size}`);
79+
80+
const missingKeys = [];
81+
for (const key of allKeys) {
82+
if (!keys.has(key)) {
83+
missingKeys.push(key);
84+
}
85+
}
86+
87+
if (missingKeys.length > 0) {
88+
console.error(
89+
`\nERROR: Fallback locale (${localeToCheck}) is missing ${missingKeys.length} key(s):`,
90+
);
91+
missingKeys.sort().forEach((key) => {
92+
console.error(` - ${key}`);
93+
});
94+
console.error(
95+
`\nTo fix this issue, add the missing keys to ${translationsPath}/${localeToCheck}`,
96+
);
97+
errorsCount++;
98+
missingLocaleCount += missingKeys.length;
99+
} else {
100+
console.log(
101+
`\nSUCCESS: Fallback locale (${localeToCheck}) contains all ${allKeys.size} keys.`,
102+
);
103+
}
104+
}
105+
106+
if (errorsCount > 0) {
107+
console.log(`\n${missingLocaleCount} locales missing found across ${errorsCount} locales.`);
108+
process.exit(1);
109+
}
110+
} catch (error) {
111+
console.error("Unexpected error.");
112+
console.error(error);
113+
process.exit(1);
114+
}
115+
})();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "static-analysis-locale",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
12+
"description": ""
13+
}

0 commit comments

Comments
 (0)